[BUG] Esc in the `claude --resume` picker leaves the cursor mid-frame; the shell prompt is drawn over the leftover session list

Status Open
Reported on v2.1.289
Maintainer reply None cached
Activity 0 comments · opened Oct 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

Cancelling the claude --resume session picker with Esc exits with the cursor parked in the
middle of the picker's frame (on the row of the first session entry, column 2), without
erasing the rest of the frame below it and without a trailing newline. The shell then draws
its prompt at that position, and the rest of the session list stays on screen underneath the
prompt.

  • fish: prints its missing-newline marker, then the prompt, with ~35 lines of the list left below.
  • bash: the prompt overwrites the start of a list row, with the remainder left below.
  • zsh: looks clean only because zle clears to the end of the screen when drawing the prompt.

A normal session exit (Ctrl-D twice) is clean, so this is specific to cancelling the picker.

What Should Happen?

On cancel, the picker should erase its frame, or at least leave the cursor on a fresh line
below it, as a normal session exit does, so the shell prompt is not drawn inside the old frame.

Error Messages/Logs

Pane contents after Esc (fish, 200x62 tmux pane, blank lines removed, list truncated):

 host  ~/repo (main) % claude --resume
--------------------------------------------------------------------------------
  Resume session (1 of 50)
  +------------------------------------------------------------------------------+
  | Search...                                                                    |
  +------------------------------------------------------------------------------+
    repo
  ⏎
 host  ~/repo (main) [1] %
    /plugin
    4 hours ago · main · 6.4KB
    Claude code plugin autoupdate
    1 day ago · main · 363.3KB
    ...
  ↓ Chrome icon light/dark mode transition
    4 days ago · main · 1.6MB
    Ctrl+A to show all projects · Ctrl+B to only show current branch · Space to preview · ...

The ⏎ is fish's marker for "previous output did not end in a newline"; the lines under the
prompt are the remainder of the picker frame.

Steps to Reproduce

Reproduces every time, in a real terminal (iTerm2) and in a throwaway tmux pane:

tmux -L repro new-session -d -x 200 -y 62 fish   # or: bash --norc
tmux -L repro send-keys 'claude --resume' Enter; sleep 6
tmux -L repro send-keys Escape; sleep 3
tmux -L repro capture-pane -p | grep -v '^ *$'
tmux -L repro kill-server

Needs a project with enough past sessions that the list has a dozen or so entries.

Claude Model

Not model-related.

Is this a regression?

I don't know

Claude Code Version

2.1.289 (Claude Code)

Platform

Anthropic API

Operating System

macOS (also seen on Ubuntu Linux over ssh)

Terminal/Shell

iTerm2 and tmux 3.7c; fish 4.9.3 and bash 5.3 show it, zsh hides it

Additional Information

Shell-side workaround (fish), which confirms the cursor is left mid-frame:

function __clear_after_claude --on-event fish_postexec
    string match -rq '^\s*claude(\s|$)' -- $argv[1]; or return
    printf '\r\e[J'
end

View original on GitHub ↗