std/console/lib
std/console/src/lib.trb
Writing to the two standard streams. panic is not here but in std/core: half of std/core calls it
(Result.expect, every out-of-bounds index), and a package that everything depends on must not depend on this one.
fn print
native fn print(...values: Show)
Writes the values to standard output, separated by spaces, followed by a line break.
fn printError
native fn printError(...values: Show)
The same for standard error: diagnostics, progress, everything that is not the result of the program.
fn isTerminal
native fn isTerminal(): Bool
Whether standard output is a live terminal - a console, not a pipe or a file.
fn printErrorRaw
native fn printErrorRaw(text: String)
text to standard error exactly as given: no join with a later call, no line break. A prompt writes with this,
because a prompt is not a line of its own - what is typed after it finishes the line.
fn installInterruptHandler
native fn installInterruptHandler(): Void
From this call on, Ctrl+C sets the flag interrupted answers and clears, instead of ending the process.
Idempotent. torb repl is the one caller today (docs/design/REPL.md section 2).
fn interrupted
native fn interrupted(): Bool
Whether Ctrl+C arrived since the last call to this or to installInterruptHandler, which this also clears.