Termify::Terminal
Add UNIX characteristics
Constants
Row reported when the terminal cannot be asked, or answers unintelligibly.
Constructors
Instance methods
Returns true if the terminal is likely to support ANSI color output.
Does not change the console; use #setup_console for that.
Return the row number of the cursor's current position.
Asking requires a terminal on both ends: the query goes to the output and
the reply arrives on the input. Where either is redirected there is nobody
to answer, so this returns DEFAULT_CURSOR_ROW rather than waiting.
Where queries are written and replies are read. Everything built on
Terminal writes through output rather than reaching for STDOUT,
so a caller and its terminal cannot address different devices.
True when both ends are a terminal, and so when a query may be asked at all. Overriding this is how a spec reaches the code beyond the gate.
Restore console (after setup); does nothing on *nix platforms but is needed for Windows
Setup console terminal mode; does nothing on *nix platforms but is needed for Windows
Returns true if the terminal advertises truecolor support. Callers should fall back to 256-color or 8/16 if this returns false.
Temporarily switch input to raw + VT mode, yield, then restore input mode. Output mode is left as-is (already set up by setup_console).