Skip to content

terminal-pilot screenshot outputs blank terminal while read-screen has text #529

Description

@kamilio

Summary

terminal-pilot screenshot omits every PTY glyph even though read-screen sees the expected screen contents. The default PNG contains only the dark background and window controls; --no-window produces a single-color dark image.

Versions

  • poe-code: 4.0.42
  • terminal-pilot: 0.0.50
  • Node.js: v22.22.0
  • OS: Linux 5.15.0-1084-aws x86_64

Minimal repro

Create /tmp/terminal-pilot-repro-screen.sh:

#!/bin/sh
printf '\033[2J\033[H\033[1;36mTERMINAL PILOT SCREENSHOT REPRO\033[0m\n\nVisible in read-screen, absent from screenshot.\n'
sleep 60

Then run:

chmod +x /tmp/terminal-pilot-repro-screen.sh
terminal-pilot create-session --session tp-blank-repro --cols 80 --rows 12 /tmp/terminal-pilot-repro-screen.sh
terminal-pilot wait-for --session tp-blank-repro --scope screen "SCREENSHOT REPRO"
terminal-pilot read-screen --session tp-blank-repro --output markdown
terminal-pilot screenshot --session tp-blank-repro -o /tmp/with-window.png
terminal-pilot screenshot --session tp-blank-repro --no-window -o /tmp/no-window.png

Actual result

read-screen correctly returns:

TERMINAL PILOT SCREENSHOT REPRO

Visible in read-screen, absent from screenshot.

Both screenshots omit that text:

  • with-window.png is 1822×1073 and visually contains only the background and three window-control circles.
  • no-window.png is 1822×1013 and has exactly one RGB color across the entire image.

This also reproduces with a full-screen Node TUI that uses absolute cursor positioning and incremental SGR updates, at 120×28 and 120×34. Resizing/redrawing did not restore glyphs.

Expected result

The PNG should contain the same visible glyphs and styling represented by read-screen, with or without the optional window frame.

Suggested regression test

Create a session that emits plain text plus absolute cursor positioning/SGR styling, assert the text is present in read-screen, render both screenshot variants, and verify non-background pixels exist in the expected terminal cell regions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions