Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I clear the console in a Lua Program

Tags:

console

lua

I'm making my first Lua program with the console, and I need to find out how to remove all the text in the console without just appending a ton of \n's.

like image 246
AbundanceOfNames Avatar asked Apr 20 '14 20:04

AbundanceOfNames


People also ask

How do you clear the console code?

Console clear() The clear() method clears the console. The clear() method also write "Console was cleared" in the console.

How do I use Lua console?

To use the Lua Console: select the environment you want from the dropdown below the status indicators. enter some code in the first text field. Press Ctrl+Enter or click the “Execute” button to send the code snippet to DCS: World and wait for the result to be displayed at the bottom.

Which control character clears terminal screen in Linux?

Clear Terminal via Ctrl+L / Ctrl+Shift+K Shortcut Keyboard shortcuts also work for clearing the terminal, depending on the terminal emulator. An alternative in some terminal emulators is Ctrl + Shift + K . The command provides the same output as Ctrl + L .


1 Answers

You can use os.execute().

On Windows:

os.execute("cls")

On Unix:

os.execute("clear")
like image 117
Victor Martins Avatar answered Nov 03 '22 00:11

Victor Martins