Skip to content

Do not repaint the interactive footer after Ctrl-D shutdown #32

Closed

Description

@TaewoooPark

Problem

Ctrl-D at an empty interactive prompt exits with code 0, but leaves the live composer box and ? for shortcuts hint on screen. Reproduced on main 9fb0d50 (0.3.3) and PR #29's original head ccf79b4; this is not introduced by #29.

Reproduction

  1. Start the built CLI interactively in an 80×24 terminal and leave the draft empty.
  2. Press Ctrl-D.
  3. Wait for process exit and drain all remaining PTY output.

Actual: exit code 0, but the input box and shortcut hint remain as if they were still interactive. Expected: terminal cleanup completes without repainting the live prompt, leaving the cursor in a sensible position for the next shell prompt while preserving useful transcript output.

Verified with xterm.js 6.0.0 and a real macOS PTY. The bridge explicitly drained final output after process exit, so the observation is not based on dropping final cleanup bytes. Native Terminal.app shell handoff has not yet been checked.

Likely starting point

Inspect packages/cli/src/chat.ts: onKey() calls onControl() and then unconditionally refreshes; Ctrl-D can reach quit() → finish() during that control call. Check whether refresh runs after Screen.finish() has cleared/restored the terminal. Verify the lifecycle before choosing a fix.

Acceptance criteria

  • Empty-prompt Ctrl-D exits 0 without redrawing the live composer/hint after cleanup.
  • Normal terminal modes and cursor visibility are restored; settled transcript is retained.
  • Tests cover post-finish output ordering and double Ctrl-C exit, without changing Ctrl-D delete-forward in a nonempty draft or Ctrl-C interruption during an active run.
  • A visible PTY-backed terminal test drains final output and confirms a clean handoff to the next prompt.

Keep the change limited to shutdown/input lifecycle. Do not broaden it into active-tool process cancellation (#16/#17).

Activity

  1. added
    bugSomething isn't working
    help wantedExtra attention is needed
    priority:P3Small output or presentation correction
    area:uxUser-facing interaction and diagnostics
    on Sep 22, 2026
  2. added a commit that references this issue on Oct 17, 2026
    3fcb52b
  3. TaewoooPark commented on Oct 17, 2026

    @TaewoooPark
    OwnerAuthor

    Resolved by #43, squash-merged as 3fcb52b. Thanks @nimbly1! The final PR also includes a small maintainer regression for nonempty-draft Ctrl-D editing.

    Verified on an Apple Silicon Mac with the actual built CLI in visible xterm.js 6.0.0 connected to a real macOS PTY: base reproduces the stale composer, patched Ctrl-D and double Ctrl-C exit 0 without repainting; the transcript remains, terminal modes/cursor are restored, final PTY output is drained, and the next zsh prompt executes echo SHELL_HANDOFF_OK. Ctrl-D delete-forward and Ctrl-C interruption followed by a reusable prompt also pass. These were local SSE fixtures, not live model or native Terminal.app tests.

    The integrated 0.4.3 tree passes all 1,676 tests/97 files, typecheck, build, and tool-schema lint. PR validation details · Post-merge main CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxUser-facing interaction and diagnosticsbugSomething isn't workinghelp wantedExtra attention is neededpriority:P3Small output or presentation correction

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions