ctx terminal
A UTF-8 vector graphics and audio capable terminal, with support for
the ctx vector protocol, itself implemented
with ctx, thus able to run in many places using SDL2, on
KMS/DRM (linux and openbsd verified), fbdev and other ctx backends. It
contains an on-screen keyboard useful on single or multi-touch displays.
Fullscreen use is optimized for two 80 column wide terminals side by side
on a laptop - the UI is not yet tailored for portrait mode.
The clock in the above screenshot is a shellscript.
The ctx terminal and the core parsers in ctx (and rasterization as driven
by it) has been fuzz tested with afl+ for many cycles, and even earlier
crude vt specific fuzzing for the terminal uncovered problems also in
screen, mlterm, zutty and other terminals.
Exhaustive list of supported
escape sequences acts as a
refererence for further development and a shorthand cheat-sheet
for writing code for the terminal.
- VT4xx, ECMA-48
- Almost full vt100 and vt220 escape sequence handling, scrollback, like xterm/*, dterm window manipulation (among tabs/clients),*/ bracketed paste, 256 and 24bit colors are supported - and a growing subset of vt420 and other relevant terminal escape sequences.
-
-
The 16 ANSI colors are tuned for optimizing color contrast, even with color vision deficiencies.
- ctx vector graphics
- Using the ctx protocol, by first
entering ctx mode with \e[?7020h which creates a new
or accesses an existing vector drawing context for the current
line.
- atty
- audio recording and playback (only raw pcm for now, opus codec NYI)
- sixels
- DEC compatible raster encoding, with 6row high 1bit raster lines * colors used.
- kitty graphics
- max 4 images per line, no z-ordering - using stb_image for PNG decoding.
- iterm2 inline images
- iterm2 inline image image protocol in one bulk base64 transfer, using stb_image for image decoding.
- mouse xterm
- xterm mouse reporting modes - somewhat incomplete
- dterm
- Most of dterms window management integration.
- UTF-8
- The terminal uses 7bit control codes, and reserves bytes>127 for use in character data.
- vt102 escapes
- >100 points on the vttest score card
- ECMA-48 colors
- The standard defining the 16 colors
- ECMA-48 justification
- Only implementing wordwrap for now, can be extended with more.
- pixel mouse
- escape sequence to get pixel coordinates for mouse events
- ECMA-48 proportional
- Limited predictable proportional rather than monospaced text, for best results render proportional text in a finall pass, starting with left most column.
- multiplexed streams
- A bi-directional APC interface, used in fullscreen ctx
contexts, streams are torn down on session close.
Streams are identified by eid and a numberic client
assigned id, for file upload eids are announced as streams -
and download initied by the terminal on demand. Plans are underway to let this create additional or overlay ctx contexts, as well as audio for mic and speaker, perhaps optionally with mp3 or opus, as well as video.
Missing bits:
- hyperlink escape sequence
- Drag to select in vim
- The final result of the interaction is correct, but intermediate frames are perhaps not queued for draw?
- Cursor setting
- alt-screen issue
- only code 1049 works fully specs compliant, the others
leave the cursor in the wrong spot.
- vt52 cursor keys
- not passing vttest in vt52 mode
- audio
- should be using opus rather than 8khz 8bit ulaw, and reimplemented on top of new stream transports.
- search in tab
Historic predecessors for
vector or graphics capable terminals include:
ReGIS,
The MGR Window System
and ripscript have
provided more graphics rich terminal experiences in the past.