Exit resume hint overlaps with buddy sprite in scrollback mode

Resolved 💬 4 comments Opened Apr 2, 2026 by QinMing Closed Apr 9, 2026

Bug

Since the /buddy companion feature was added, the "Resume this session with:" exit message overlaps with the buddy sprite and statusline when exiting with Ctrl+C+C in scrollback (non-fullscreen) mode. Sometimes the claude --resume <id> line is completely hidden, losing the session ID.

Screenshot

                                                                -+-
                                                              n______n
────────────────────────────────────────────────────────  ( @    @ )
❯                                                            (   oo   )
Resume this session with:─────────────────────────   `------´
claude --resume 63800b75-...                          ● high · /effort      Eaves

Root cause

In src/utils/gracefulShutdown.ts, the exit flow is:

  1. cleanupTerminalModes() (line 436) — in scrollback mode, isAltScreenActive is false so the Ink unmount is skipped (line 87). detachForShutdown() sets isUnmounted = true and cancels pending renders but does not clear the Ink frame from the terminal.
  2. printResumeHint() (line 437) — writes the resume text via writeSync(1, ...) starting from the cursor position left by Ink's last render.

The cursor after Ink's last render is at the prompt input position (the line), but the buddy sprite extends 4-5 rows below that on the right side. writeSync overwrites the left columns but the buddy ASCII art remains on the right.

The resume hint (3 lines) is shorter than the buddy sprite (5-6 lines), so the final cursor ends up in the middle of leftover buddy content. The shell prompt then draws there, further clobbering things.

Suggested fix

Add \x1b[J (ANSI ED — Erase in Display, from cursor to end of screen) before the resume hint text in printResumeHint():

// src/utils/gracefulShutdown.ts, line 173
writeSync(
  1,
  '\x1b[J' + chalk.dim(
    `\nResume this session with:\nclaude --resume ${resumeArg}\n`,
  ),
)

This clears the buddy sprite, statusline, and any other Ink remnants from the cursor position downward before writing the resume hint. In alt-screen mode the cursor is already on the main buffer, so the erase is harmless.

Workaround

Use claude --list to recover session IDs when the exit display is mangled.

Environment

  • Claude Code 2.1.90
  • macOS (Darwin 25.3.0, arm64)
  • Non-fullscreen (scrollback) mode with buddy enabled and custom statusline

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗