const classjig::Term

sys::Obj
  jig::Term

Terminal and process utilities.

bold

Source

const static Str bold := "\u{1b}[1m"

clearLine

Source

const static Str clearLine := "\r\u{1b}[2K"

dim

Source

const static Str dim := "\u{1b}[2m"

exec

Source

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.join does not wait for the output pump thread, so after exit we wait until isDone returns true, or output has been quiet for 250ms.

fan

Source

static Str[] fan()

Path to fan launcher for current runtime.

fant

Source

static Str[] fant()

Path to fant launcher for current runtime.

green

Source

const static Str green := "\u{1b}[32m"

isTty

Source

static Bool isTty()

Is stdout an interactive terminal.

magenta

Source

const static Str magenta := "\u{1b}[35m"

red

Source

const static Str red := "\u{1b}[31m"

reset

Source

const static Str reset := "\u{1b}[0m"

syncBegin

Source

const static Str syncBegin := "\u{1b}[?2026h"

syncEnd

Source

const static Str syncEnd := "\u{1b}[?2026l"

upClearLine

Source

const static Str upClearLine := "\u{1b}[1A\u{1b}[2K"

width

Source

static Int width()

Terminal width in columns, or 80 if unknown.

write

Source

static Void write(OutStream out, Str s)

Write frame s to out as one encoded buffer and flush. Writing char by char lets System.out split 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

Source

const static Str yellow := "\u{1b}[33m"