Termvas

Terminal image output · Ruby

Put the frame in the terminal.

Display RGBA images with half blocks, Kitty, iTerm2, or Sixel, and read keyboard and mouse input.

gem install termvas

termvas · image.png 320 × 180
BLOCKSKITTYITERM2SIXEL
Terminal viewportprotocol: half blocks

Images out. Input back.

Terminal protocols, frame fitting, and input parsing for interactive applications.

01

Detect the display

Choose a protocol automatically or force one with an environment variable.

02

View and play

Inspect images or play frame sequences with nearest-neighbor fitting.

03

Parse input safely

Read split CSI, keyboard, wheel, and SGR mouse events.

A small first step

Start with one example.

Install the gem, then follow the project guide for platform requirements and the full API.

Read the installation guide ↗

termvas doctor
termvas view image.png
termvas play frames/*.png --fps 10

backend = Termvas::Backend.new(320, 180, protocol: :blocks)
# rgba_bytes contains top-down RGBA8 pixel data.
backend.set_pixels(rgba_bytes, 320, 180)
backend.close