No matching definitions.

ansi/term

src/ansi/term.tur

terminal setup, capability detection, key reading, resize.

defn

term-size

(term-size)

return terminal dimensions as a (cons rows cols) pair.

A two-element cons cell { head=rows, tail=cols }. Falls back to (24 . 80) when TIOCGWINSZ is unavailable.

(let [sz (term-size)] ...)  ; head/tail extract rows/cols

Since: tur-ansi AN0

defn

term-no-color?

(term-no-color?)

1 when $NO_COLOR is set and non-empty, 0 otherwise.

defn

term-color-support

(term-color-support)

detect color depth from environment.

0 = no color (NO_COLOR set, or TERM=dumb) 1 = 4-bit (16 colors) 2 = 8-bit (256-color palette) 3 = 24-bit true-color

defn

term-image-protocol

(term-image-protocol)

detect inline-image protocol support.

0 = none, 1 = kitty, 2 = iterm2, 3 = sixel Detection is conservative; callers may still fall back to a text placeholder when a non-zero result fails at runtime.

defn

term-enable-raw

(term-enable-raw)

enable raw terminal mode and install SIGWINCH self-pipe.

defn

term-disable-raw

(term-disable-raw)

restore cooked mode and tear down the SIGWINCH self-pipe.

defn

term-on-resize

(term-on-resize [callback :ptr<void>])

register a callback invoked on SIGWINCH.

callbacka function pointer of signature void(*)(void), or 0 to
remove the current callback.
The callback fires from inside term-read-key (after the resize byte
has been drained from the self-pipe and before "<Resize>" is returned),
so it runs in normal process context, not from the signal handler.
defn

term-read-key

(term-read-key)

block until one keypress; return a normalized key string.

defn

term-read-key-timeout

(term-read-key-timeout [ms :int])

like term-read-key but returns "" after ms millis.

Internal definitions
__ansi-collect
__ansi-scripted-pop
__ansi-keybuf-ptr
__ansi-strdup-cstr
__ansi-read-key-impl