term.clear

From ComputerCraft
Jump to: navigation, search

term.clear
Function
Syntax
term.clear()
Returns nil
API term
Source CC:Tweaked (source)

Clears the terminal object using the current background colour. The term's cursor position, text colour and background colour states remain unchanged.

ExampleExampleClear a terminal
Clears the current term.
Code
print("Hello, world!")
sleep(1)
term.clear()
Output Hello, world! is printed, and then disappears after 1 second.
ExampleExampleClear a terminal with a colour
Clears the current term with a red background colour.
Code
term.setBackgroundColour(colours.red)
term.clear()
Output The screen is cleared and filled with red.