Skip to content

fix: forward Cmd+Delete and Option+Delete to PTY#92

Merged
gi11es merged 2 commits into
gi11es:masterfrom
quarterpound:fix/cmd-delete-clears-line
May 29, 2026
Merged

fix: forward Cmd+Delete and Option+Delete to PTY#92
gi11es merged 2 commits into
gi11es:masterfrom
quarterpound:fix/cmd-delete-clears-line

Conversation

@quarterpound

Copy link
Copy Markdown
Contributor

Cmd+Backspace now sends ^U (kill-line-to-beginning) and Option+Backspace sends ESC+DEL (backward-kill-word), matching macOS text-field conventions and what bash/zsh/Claude Code's input field interpret.

Previously these key combos fell through to SwiftTerm, which forwarded a plain DEL byte for both — so neither shortcut did anything useful. Option-modified keys skip performKeyEquivalent entirely, so the existing keyDown monitor (already used for paste) is the only reliable place to intercept them.

aliottertext and others added 2 commits May 27, 2026 13:24
Cmd+Backspace now sends ^U (kill-line-to-beginning) and Option+Backspace
sends ESC+DEL (backward-kill-word), matching macOS text-field conventions
and what bash/zsh/Claude Code's input field interpret.

Previously these key combos fell through to SwiftTerm, which forwarded a
plain DEL byte for both — so neither shortcut did anything useful.
Option-modified keys skip performKeyEquivalent entirely, so the existing
keyDown monitor (already used for paste) is the only reliable place to
intercept them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cmd+Delete and Option+Delete wrote directly to the PTY without checking
handlesPasteShortcuts, so they could escape the 0.3s startup keystroke
suppression window (which exists so stray keys don't corrupt a new Claude
tab's pending initial command). Hoist the handlesPasteShortcuts gate to
cover all input shortcuts, matching the existing paste behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@gi11es gi11es merged commit ac2a10c into gi11es:master May 29, 2026
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