const classjig::Term
sys::Obj jig::Term
Terminal and process utilities.
- bold
const static Str bold := "\u{1b}[1m"- clearLine
const static Str clearLine := "\r\u{1b}[2K"- dim
const static Str dim := "\u{1b}[2m"- exec
static Int exec(Str[] cmd, |Str onLine, |->Bool? isDone := null)Run process and deliver each line of merged stdout/stderr to
onLine; returns exit code.Process.joindoes not wait for the output pump thread, so after exit we wait untilisDonereturns true, or output has been quiet for 250ms.- fan
static Str[] fan()Path to
fanlauncher for current runtime.- fant
static Str[] fant()Path to
fantlauncher for current runtime.- green
const static Str green := "\u{1b}[32m"- isTty
static Bool isTty()Is stdout an interactive terminal.
- magenta
const static Str magenta := "\u{1b}[35m"- red
const static Str red := "\u{1b}[31m"- reset
const static Str reset := "\u{1b}[0m"- syncBegin
const static Str syncBegin := "\u{1b}[?2026h"- syncEnd
const static Str syncEnd := "\u{1b}[?2026l"- upClearLine
const static Str upClearLine := "\u{1b}[1A\u{1b}[2K"- width
static Int width()Terminal width in columns, or 80 if unknown.
- write
static Void write(OutStream out, Str s)Write frame
stooutas one encoded buffer and flush. Writing char by char letsSystem.outsplit a frame on newlines and its 128 byte buffer, which Windows consoles paint as separate partial frames. The frame is also wrapped in synchronized output (DEC mode 2026) so terminals that support it paint it at once; others ignore the unknown mode.- yellow
const static Str yellow := "\u{1b}[33m"