Take Command's tab windows can display ReGIS ("REmote Graphics Instruction Set") vector graphics sent by a shell or remote host, in addition to the SIXEL and iTerm2 raster inline-image protocols.
What is ReGIS?
ReGIS is a text-based vector-graphics command language introduced on DEC VT3xx-series terminals. Instead of transmitting raw pixel data (as SIXEL does), a ReGIS payload describes a sequence of drawing operations -- move to a point, draw a line, draw a circle, set the current color, and so on.
How it's delivered
Like SIXEL, ReGIS graphics are natively sent as a DCS (Device Control String):
ESC P p <ReGIS command text> ESC \
Take Command distinguishes a ReGIS payload from a SIXEL payload by looking at the DCS parameter/identifier prefix: SIXEL streams contain a `q` introducer, while ReGIS streams use a `p` introducer instead.
OSC 1337 base64 fallback
ConPTY/conhost passthrough does not forward raw DCS payloads reliably, so Take Command also recognizes ReGIS delivered through the iTerm2-style OSC 1337 tunnel, base64-encoded, alongside the existing `Sixel=` fallback of the same form:
ESC ] 1337 ; ReGIS=<base64 of the raw "p..." ReGIS command text> BEL
This is the recommended way to send ReGIS from a TCC script, since it is not subject to the same forwarding limitations as raw DCS. In TCC this can be produced with the `%64ENCODE[s,<string>]` function -- note the `s,` prefix, which is required to base64-encode a literal string rather than a file (see TestReGIS.btm for a working example).
Supported command subset
The initial implementation supports the common subset of the ReGIS command language, sufficient for simple diagrams and plots:
Command |
Description |
P(x,y) |
Position -- move the current point without drawing. Supports both absolute (`x,y`) and relative (`+x,+y` / `-x,-y`) coordinates |
V(x,y[,x,y...]) |
Vector -- draw one or more line segments from the current point through each listed point in turn. |
C(radius) |
Curve -- draw a circle of the given radius centered at the current point. (Arc sweeps and non-circular curves are not supported; a full circle is drawn instead.) |
S([w,h]) |
Screen -- configure the addressable drawing area (canvas) size. |
W(C<n>) |
Write control -- select the current drawing colour from the 8-colour ReGIS palette. Pattern, shading, and intensity options are not supported. |
Commands or options outside this subset (text placement `T`, macrographs `@`, palette loading `W(I(...))`, input `F`, load `L`, etc.) are parsed enough to be skipped without error, so a command stream that mixes supported and unsupported commands still renders whatever it can.
Canvas sizing
If the ReGIS command stream includes an explicit `S([w,h])` screen-extent command, that size is used for the canvas. Otherwise, the canvas defaults to the current terminal viewport's pixel dimensions (character columns/rows multiplied by the current font's cell width/height).
After rasterizing, the decoder trims any fully transparent rows off the bottom of the canvas so the reported image height only spans the rows that were actually drawn into. This matters most when no explicit `S(...)` extent is given: without trimming, the default full-viewport canvas height would make the image appear to occupy far more terminal rows than it visually needs, leaving a trail of blank lines below it once the cursor skips past the image's (untrimmed) row span.
Limitations
•Only the common P/V/C/S/W subset described above is implemented.
•Arcs, curves other than full circles, filled regions/patterns, and text placement are not supported.
•Only the 8-colour standard ReGIS palette is available; custom palette loads are ignored.
•Very large canvases are clamped to a maximum of 4096x4096 pixels.
•Raw DCS delivery is not guaranteed to reach Take Command under ConPTY/conhost passthrough; prefer the OSC 1337 `ReGIS=` base64 fallback described above for reliable delivery from scripts.