termscreen

package
v0.104.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package termscreen reads a tmux pane capture WITH its styles (`tmux capture-pane -p -e`) into rows of cells. It is the one SGR reader: hermeshost reads Hermes's input box by italic and background, ccdialog reads Claude Code's ghost suggestion by dim.

🔴 A LEAF: it imports only the standard library. cmd/ccd links it (through ccdialog) into the agent pod, which internal/modulegate holds to no network or storage client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	R      rune
	Italic bool
	Dim    bool
	Bg     bool
}

Cell is one character of a captured screen, whether it is italic, whether it is dim (faint, SGR 2: Claude Code draws its ghost prompt suggestion so — ccdialog.InputBox reads it), and whether it has a background colour (Bg). A draft typed in Hermes's input box is drawn in the input's style, which has none at the pin (and an escape sequence typed or pasted into the box is drawn as text, `^[`, never obeyed), so a background is something a draft cannot draw.

type Screen

type Screen struct {
	Rows [][]Cell
}

Screen is a pane as `tmux capture-pane -p -e` prints it: its rows, top to bottom, as cells.

func ParseScreen

func ParseScreen(capture string) Screen

ParseScreen reads a `capture-pane -p -e` capture. Of SGR only italic (3 on; 23, 0 or an empty SGR off), dim (2 on; 22, 0 or an empty SGR off) and whether a background colour is set (40-47, 100-107, 48;…; 49, 0 or an empty SGR off) are kept; every other escape sequence is dropped. A sequence it cannot read ends at the next letter, never later.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL