Skip to content

Commit 6294b79

Browse files
davindicodeclaude
andcommitted
Add 0-9 number keys to sticky modifier tab
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1c14899 commit 6294b79

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

app/components/terminal/InputBox.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,17 @@ const STICKY_MODES: { id: StickyMode; label: string }[] = [
139139
];
140140

141141
function getStickyKey(ch: string, mode: StickyMode): string {
142+
const isLetter = ch >= "A" && ch <= "Z";
142143
switch (mode) {
143144
case "ctrl":
144-
return String.fromCharCode(ch.charCodeAt(0) - 64);
145+
// Ctrl+Letter = control code, Ctrl+Digit = send via CSI u
146+
return isLetter
147+
? String.fromCharCode(ch.charCodeAt(0) - 64)
148+
: `\x1b[${ch.charCodeAt(0)};5u`;
145149
case "ctrl+shift":
146150
return `\x1b[${ch.charCodeAt(0)};6u`;
147151
case "alt":
148-
return `\x1b${ch.toLowerCase()}`;
152+
return `\x1b${isLetter ? ch.toLowerCase() : ch}`;
149153
case "alt+shift":
150154
return `\x1b${ch}`;
151155
}
@@ -504,6 +508,17 @@ export default function InputBox() {
504508
))}
505509
</div>
506510
<div className="flex flex-wrap gap-1">
511+
{"0123456789".split("").map((ch) => (
512+
<button
513+
key={ch}
514+
{...repeatProps(getStickyKey(ch, stickyMode))}
515+
disabled={!activeSessionId}
516+
title={`${STICKY_MODES.find((m) => m.id === stickyMode)?.label}${ch}`}
517+
className={keyBtn}
518+
>
519+
{ch}
520+
</button>
521+
))}
507522
{"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((ch) => (
508523
<button
509524
key={ch}

0 commit comments

Comments
 (0)