Expand description
A terminal, hand-rolled on libc.
ratatui is the obvious answer, and adding it to this workspace resolves 35
crates that are not already here β a 30% increase on a tree whose size (117
crates, 5.63 MiB) is a stated property of the product.
What it buys over this file is a constraint-solving layout engine and a
damage-tracked cell buffer; the TUI here has fixed panes and redraws one
screenful per keystroke. So: termios for raw mode, TIOCGWINSZ for the
size, poll(2) for input, three sigactions to survive a resize and a
kill, ANSI for the rest. libc is already in the tree for statfs.
Unix only, which is the same bet mmap, SIGTERM and the filesystem guard
already make.
StructsΒ§
- Row
- One line of the frame, built left to right with its visible width tracked separately from its bytes.
- Term
EnumsΒ§
ConstantsΒ§
StaticsΒ§
- ORIG π
- The terminal settings as they were before
Term::enter.
FunctionsΒ§
- bail π β
- Give the terminal back, then die.
- csi π
- ok_
or_ πerrno - The
termioscallsβ contract:0, or-1and the reason is inerrno. - on_
signal π - Install
hforsig, withoutSA_RESTART. - parse π
- One key off the front of
b, orParsed::Needif what is there could still grow into a longer sequence. - poll_in π
- restore π
- Put the terminal back. Idempotent, because
Drop, the panic hook and a fatal signal can all reach it and a double panic would otherwise run it twice. - take_
one π - winch π β
- A resize. Nothing to do in the handler β the delivery itself is the message,
and it arrives as an
EINTRinpoll_in.