Skip to content

claude/codex CLI: stale terminal content overlaps new output (redraw/viewport divergence) #421

Description

@khaliqgant

Observed

In the running Pear app, an agent session shows corrupted terminal rendering: after a long
task completes (a status line like "Crunched for 2m 5s") and a follow-up question is asked
("give me the full path of the file"), the terminal pane shows garbled/overlapping text —
stale content from the prior turn (a markdown spec preview) interleaved with the new
prompt/response line, rather than a clean redraw.

CLI attribution is uncertain — operator first said codex, then said it may actually be
claude. Debug BOTH --cli=claude and --cli=codex in the term-fidelity matrix; don't assume
either is exonerated until you have byte-level evidence.

Context

Related prior work:

Ask

  1. Reproduce via npm run test:term-fidelity -- --cli=claude AND --cli=codex with a
    workload that mirrors: long-running task → completion → immediate follow-up question
    referencing prior output.
  2. Root-cause per-CLI with the byte-level dump-pty discriminator before proposing a fix —
    don't declare either CLI clean/dirty on impression alone.
  3. Fix whichever CLI(s) reproduce, and add regression case(s) to the term-fidelity matrix.

cc coordinator thread: #term-fidelity channel (agent-relay workspace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions