Skip to content

Show "ESC to detach" hint immediately in spinner#135

Open
jancurn wants to merge 1 commit intomainfrom
claude/fix-esc-detach-message-9Fb0j
Open

Show "ESC to detach" hint immediately in spinner#135
jancurn wants to merge 1 commit intomainfrom
claude/fix-esc-detach-message-9Fb0j

Conversation

@jancurn
Copy link
Copy Markdown
Member

@jancurn jancurn commented Apr 2, 2026

Summary

Moved the ESC key listener setup earlier in the tool execution flow so that the "ESC to detach" hint displays immediately in the spinner, rather than waiting for the server to return a task ID.

Key Changes

  • Moved setupEscListener() call to execute before spinner initialization
  • Extracted the ESC hint text (escHintText) into a variable that's computed once based on listener availability
  • Updated spinner initialization to include the hint text immediately
  • Simplified updateSpinnerText() to use the pre-computed escHintText instead of conditionally computing it on each update

Implementation Details

The hint text is now determined upfront based on whether an ESC listener promise exists, rather than being recalculated in the spinner update loop with an additional check for capturedTaskId. This provides immediate visual feedback to users that they can press ESC to detach, without waiting for the task ID to be captured from the server response.

https://claude.ai/code/session_01WPrQYz1Qru8M6ARkaAga39

The hint was gated on capturedTaskId being set, which only happens
after the server sends a taskCreated event. Moved the ESC listener
setup before the spinner and compute the hint text once upfront so
it appears immediately when the spinner starts.

https://claude.ai/code/session_01WPrQYz1Qru8M6ARkaAga39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants