v0.7.0 36c429d

graphics.md RawHistoryFolder

Terminal images

Back to the README

vev-vt supports a subset of the Kitty graphics protocol for static images sent directly through terminal output, including the form used by:

kitten icat --transfer-mode=stream image.png

Your application reads the result through Screen.GraphicsSnapshot() and chooses how to display it. This library does not open a window.

Supported

  • PNG, RGB and RGBA images, with explicit resource limits.
  • Direct image transmission, display, placement, queries and supported deletion.
  • Chunked Base64 data, with optional zlib compression.
  • Cropping, cell-based placement, pixel offsets and z-index.
  • Movement and clipping as terminal rows scroll.

Images are stored separately from text history. The graphics package contains the image model; protocol/kittygraphics reads Kitty commands and updates it. Graphics state is allocated only when a screen receives a graphics command.

Not supported

File or shared-memory transfers, animation, image composition, relative placements and Unicode placeholders are not implemented. Image placements do not support resize reflow.

Inspect a capture without a display

The development harness reads captured terminal bytes and writes a PNG:

go run ./cmd/graphics-harness \
  -input internal/graphicsharness/testdata/demo.apc \
  -output /tmp/graphics-harness.png \
  -cols 4 -rows 4 -pixel-width 4 -pixel-height 4 -scale 64

The included example produces a blue background with a translucent red overlay. This harness is an inspection tool, not an interactive terminal emulator.

source
1# Terminal images
2
3[Back to the README](../README.md)
4
5vev-vt supports a subset of the Kitty graphics protocol for static images sent
6directly through terminal output, including the form used by:
7
8```sh
9kitten icat --transfer-mode=stream image.png
10```
11
12Your application reads the result through `Screen.GraphicsSnapshot()` and chooses
13how to display it. This library does not open a window.
14
15## Supported
16
17- PNG, RGB and RGBA images, with explicit resource limits.
18- Direct image transmission, display, placement, queries and supported deletion.
19- Chunked Base64 data, with optional zlib compression.
20- Cropping, cell-based placement, pixel offsets and z-index.
21- Movement and clipping as terminal rows scroll.
22
23Images are stored separately from text history. The `graphics` package contains
24the image model; `protocol/kittygraphics` reads Kitty commands and updates it.
25Graphics state is allocated only when a screen receives a graphics command.
26
27## Not supported
28
29File or shared-memory transfers, animation, image composition, relative
30placements and Unicode placeholders are not implemented. Image placements do
31not support resize reflow.
32
33## Inspect a capture without a display
34
35The development harness reads captured terminal bytes and writes a PNG:
36
37```sh
38go run ./cmd/graphics-harness \
39  -input internal/graphicsharness/testdata/demo.apc \
40  -output /tmp/graphics-harness.png \
41  -cols 4 -rows 4 -pixel-width 4 -pixel-height 4 -scale 64
42```
43
44The included example produces a blue background with a translucent red overlay.
45This harness is an inspection tool, not an interactive terminal emulator.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 13

↑↓ moveenter openesc close