Fullscreen: Cmd+C and Ctrl+Shift+C clear the selection instead of copying it
Fullscreen: Cmd+C and Ctrl+Shift+C clear the selection instead of copying it
Only the hardcoded Ctrl+C copies. Both keys the docs advertise for copying —Cmd+C and Ctrl+Shift+C — clear the selection and copy nothing.
Environment
- Claude Code 2.1.212
- macOS (darwin 25.5.0)
- Ghostty 1.3.1 (
TERM=xterm-ghostty,TERM_PROGRAM=ghostty) tui: "fullscreen"in~/.claude/settings.json- No
~/.claude/keybindings.json(stock defaults)
Steps to reproduce
/tui fullscreen- Click-and-drag to select text in the conversation
- Press
Cmd+C(orCtrl+Shift+C)
Expected
Selection is copied; a copied N chars to clipboard toast appears.
Per the docs (/en/fullscreen):
With Copy on select off, pressCtrl+Shift+cto copy manually. On terminals that support the kitty keyboard protocol, such as kitty, WezTerm, Ghostty, and iTerm2,Cmd+calso works.
And /en/keybindings lists selection:copy with default Ctrl+Shift+C / Cmd+C.
Actual
The selection highlight vanishes and nothing is copied. No toast. The clipboard
is unchanged. Reproduces identically for Cmd+C and Ctrl+Shift+C.
Only plain Ctrl+C copies — which is what the footer hint (ctrl+c to copy)
actually advertises, and it is the only key that works.
The terminal is not at fault
Ghostty emits a correct kitty encoding for Cmd+C. Probed with the kitty
keyboard protocol enabled at flags=1 (the same mode Claude Code requests):
Cmd+C -> 1b 5b 39 39 3b 39 75 ESC[99;9u keycode 99 ('c'), mods 9-1=8 = SUPER
Ctrl+C -> 1b 5b 39 39 3b 35 75 ESC[99;5u keycode 99 ('c'), mods 5-1=4 = CTRL
So the key reaches Claude Code with the Super bit intact.
Decode and binding are also correct
From the 2.1.212 bundle:
- Kitty protocol is enabled for Ghostty. It is gated on an allowlist that
includes it:
``js``
KRg = ["iTerm.app","kitty","WezTerm","ghostty","tmux","windows-terminal","WarpTerminal"]
function YRg(e){ return KRg.includes(e ?? Z.terminal ?? "") }
function __e(){ return YRg() ? LLe + Tiu + Siu : "" } // ESC[<u ESC[>1u ESC[>4;2m
- The modifier decoder handles Super correctly (
9-1=8->super:true):
``js``
function Kfu(e){ let t=e-1; return {shift:!!(t&1), meta:!!(t&2), ctrl:!!(t&4), super:!!(t&8)} }
- The keystroke parser maps
cmdto Super correctly:
``js``
case"cmd": case"command": case"super": case"win": r.super=!0; break;
- Both keys are bound in the
Scrollcontext:
``js``
{context:"Scroll", bindings:{ ..., "ctrl+shift+c":"selection:copy", "cmd+c":"selection:copy", ... }}
Likely cause
The selection-active key interceptor special-cases only ctrl+c, then treats
every other key as "dismiss the selection":
Dxt((E,T)=>{
if(!o.hasSelection()) return;
if(T.escape) return o.clearSelection(), !0;
if(T.ctrl && !T.shift && !T.meta && E==="c"){ /* copy */ return !0 } // ctrl only
...
if(VDp(T)) o.clearSelection(); // <-- everything else clears
}, {isActive:l})
VDp returns true (= clear) for anything that is not a wheel/page/ctrl+home/end
or a shift/meta/super-modified arrow:
function VDp(e){
if(e.wheelUp||e.wheelDown) return !1;
if(e.pageUp||e.pageDown) return !1;
if((e.home||e.end)&&e.ctrl) return !1;
if((e.leftArrow||e.rightArrow||e.upArrow||e.downArrow||e.home||e.end)&&(e.shift||e.meta||e.super)) return !1;
return !0;
}
Cmd+C (super) and Ctrl+Shift+C (ctrl+shift) both miss the ctrl-only copy
branch and both hit VDp -> clearSelection().
Note the copy branch's !T.shift also explicitly excludes Ctrl+Shift+C.
Observed behavior matches this exactly: the highlight disappears (clearSelection
ran) and no copy happens. The selection:copy binding either never fires or
fires after the selection is already gone.
Ctrl+C is a reserved shortcut ("Hardcoded interrupt/cancel") and so cannot go
through keybinding dispatch — which is presumably why it is special-cased here.
That makes it the only copy key that works, and leaves the two documented ones
non-functional.
Suggested fix
Let the interceptor fall through for keys bound to selection:copy (or addsuper+c / ctrl+shift+c to the copy branch) before VDp clears the selection.
Impact
Both documented manual-copy shortcuts are unusable in fullscreen. Users who turn
off Copy on select have only Ctrl+C, and any attempt at the documented
shortcuts destroys the selection they were trying to copy.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗