term.redirect

From ComputerCraft
Jump to navigation Jump to search

term.redirect
Function
Syntax
term.redirect()
Returns table terminal
API term
Source CC:Tweaked

Redirects to a terminal, and returns all Term objects available in the specified terminal.

ExampleExampleMake a window and write some text in it
Makes a window, redirects to it, writes some text, and then goes back to the native window.
Code
local win = window.create(2, 2, 10, 10, term.native())
term.redirect(win)
print("Hello world!")
term.redirect(term.native())
print("This is in the main area.")
Output Shows a window with some text in it and some text in the main term.