Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 26 Jul 14:20

Command text, reconstructed from its echo

Plain-OSC 133 terminals — Ghostty, iTerm2, Windows Terminal, any
manually installed A/B/C/D integration — mark where your prompt ends and
where execution starts, but never report what the command was. Until
now those sessions recorded as (unknown command).

backscroll now recovers the command line from the one place it still
exists: the terminal echo. Everything the shell echoed between the
prompt-end (B) and pre-exec (C) marks — your keystrokes, plus all
the line-editor noise — is replayed through a small prompt-relative
terminal model, and the final visible line is stored.

backscroll run inside Ghostty now records real command text with no
snippet installed
. Zero-config coverage is now: fish ≥ 4.0, VS Code,
kitty, WezTerm (all emitter-provided text) + Ghostty/iTerm2/plain-133
(echo reconstruction).

What the model handles:

  • backspace rubouts, mid-line insertion/deletion redraws, ^U kills,
    history-search retypes, tab-completion redraws, syntax-highlight SGR
  • long lines across autowrap — including ZLE's deferred-wrap dance
    (verified byte-for-byte against a real VT emulator's render)
  • multiline commands; marked PS2 continuations (133;P;k=s) have their
    > excluded entirely
  • full-screen fzf widgets (alternate screen is frozen; the final
    readline redraw of the picked command is what survives)
  • zsh RPROMPT and other right-aligned decorations, trimmed via a
    written-vs-never-written cell distinction that can't eat real spacing

What it refuses to do:

  • guess: absolute cursor addressing / scroll regions abort to
    (unknown command) — a wrong "command" is worse than none
  • store a line you killed: a bare ^C echo with no Enter before
    bracketed-paste teardown is detected as an abort (some emitters
    re-fire a phantom pre-exec mark on SIGINT; without this you'd get a
    stored command named ^C)
  • truncate: regions over 32 KB (a paste gone wrong) are discarded, not
    turned into a misleading prefix

Priority is unchanged: our snippet's OSC 6973 text is authoritative,
then emitter-provided cmdlines, then echo reconstruction. The snippet
remains the gold path (adds the Ctrl-X Ctrl-P picker, tab completion,
guaranteed-exact text).

Write-ups: docs/how-it-records.md
(implementation notes) and docs/osc133.md
gotcha 16 (what it takes to do this correctly).

No schema changes; drop-in upgrade from any 0.4.x.