claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Ctrl + F2 Crash Claude

Open yhan1-godaddy opened this issue 7 months ago • 2 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [x] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.4 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

Crashes if you hit Ctrl + F2. When trying to adjust brightness ..but missed the global key and hit Ctrl instead.

Steps to Reproduce

  1. Start Claude
  2. After starting, at any point, hit Ctrl + F2
  3. Crash

Expected Behavior

Not to crash

Actual Behavior

Crash

Additional Context

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Try "how do I log an error?"                                                                                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  ? for shortcuts


TypeError: Cannot read properties of undefined (reading 'startsWith')
    at EventEmitter.D (file:///Users/yhan1/.local/share/fnm/node-versions/v22.14.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:683:816)
    at EventEmitter.emit (node:events:530:35)
    at EventEmitter.emit (node:domain:489:12)
    at V71.processInput (file:///Users/yhan1/.local/share/fnm/node-versions/v22.14.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:676:718)
    at ReadStream.handleReadable (file:///Users/yhan1/.local/share/fnm/node-versions/v22.14.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:676:1049)
    at ReadStream.emit (node:events:518:28)
    at ReadStream.emit (node:domain:489:12)
    at emitReadable_ (node:internal/streams/readable:834:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21)

Total cost:            $0.0024
Total duration (API):  4s
Total duration (wall): 5s
Total code changes:    0 lines added, 0 lines removed
Token usage by model:
    claude-3-5-haiku:  3.0k input, 20 output, 0 cache read, 0 cache write

yhan1-godaddy avatar May 28 '25 19:05 yhan1-godaddy

Thanks for the bug report! I'm unable to reproduce this crash, which suggests it's specific to certain terminal configurations.

To help debug this, could you run this command and tell us what output you see?

 cat -v

  Then press Ctrl+F2 (the key combination that causes the crash), followed by Ctrl+C to exit.

This will show us the exact byte sequence your terminal sends when Ctrl+F2 is pressed. The crash likely occurs because your terminal generates an escape sequence that our key parsing library doesn't handle properly.

Please paste the output here - it should look something like ^[[1;5Q or similar. If nothing appears when you press Ctrl+F2, that's also useful information.

Thanks!

sid374 avatar May 29 '25 19:05 sid374

I got this

^[[1;5Q

yhan1-godaddy avatar May 29 '25 20:05 yhan1-godaddy

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 09 '25 14:08 github-actions[bot]