Module terminal.output

Module for writing output.

Note: This module will be available from the main terminal module, without explicitly requiring it.

Usage:

    local terminal = require "terminal"
    terminal.initialize()
    
    terminal.output.write("hello world")
    

Functions

flush () Flushes the stream.
print (...) Prints to the stream.
set_stream (filehandle) Set the stream to operate on.
write (...) Writes to the stream.


Functions

flush ()
Flushes the stream.

Returns:

    the return value of the stream's flush function
print (...)
Prints to the stream. A print compatible function that safely writes output to the stream.

Parameters:

  • ... the values to write
set_stream (filehandle)
Set the stream to operate on. This can be used to redirect output to a different stream. The default value at start is io.stderr.

Parameters:

Returns:

    true
write (...)

Writes to the stream. This is a safer write-function than the standard Lua one. Differences from the standard Lua write function:

  • parameters will be tostring-ed before writing
  • will flush the stream

Parameters:

  • ... the values to write

Returns:

    the return value of the stream's write function
generated by LDoc 1.5.0