File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,29 @@ export default class TerminalComponent {
140140 return false ;
141141 }
142142
143+ // For app-wide keybindings, dispatch them to the app's keyboard handler
144+ if ( event . ctrlKey || event . altKey || event . metaKey ) {
145+ // Skip modifier-only keys
146+ if ( [ "Control" , "Alt" , "Meta" , "Shift" ] . includes ( event . key ) ) {
147+ return true ;
148+ }
149+ const appEvent = new KeyboardEvent ( "keydown" , {
150+ key : event . key ,
151+ ctrlKey : event . ctrlKey ,
152+ shiftKey : event . shiftKey ,
153+ altKey : event . altKey ,
154+ metaKey : event . metaKey ,
155+ bubbles : true ,
156+ cancelable : true ,
157+ } ) ;
158+
159+ // Dispatch to document so it gets picked up by the app's keyboard handler
160+ document . dispatchEvent ( appEvent ) ;
161+
162+ // Return false to prevent terminal from processing this key
163+ return false ;
164+ }
165+
143166 // Return true to allow normal processing for other keys
144167 return true ;
145168 } ) ;
You can’t perform that action at this time.
0 commit comments