File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,13 +139,17 @@ const STICKY_MODES: { id: StickyMode; label: string }[] = [
139139] ;
140140
141141function 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 }
You can’t perform that action at this time.
0 commit comments