File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,32 @@ export const useTerminal = (
160160 if ( ( event . ctrlKey || event . metaKey ) && event . key . toLowerCase ( ) === 'j' ) {
161161 return false ;
162162 }
163+
164+ if ( ( event . ctrlKey || event . metaKey ) && event . key . toLowerCase ( ) === 'c' ) {
165+ if ( event . shiftKey ) {
166+ sendJsonMessage ( {
167+ action : 'terminal' ,
168+ data : { value : CTRL_C , terminalId }
169+ } ) ;
170+ return false ;
171+ }
172+ const selection = term . getSelection ( ) ;
173+ if ( selection ) {
174+ navigator . clipboard . writeText ( selection ) ;
175+ }
176+ return false ;
177+ }
178+
179+ if ( ( event . ctrlKey || event . metaKey ) && event . key . toLowerCase ( ) === 'v' ) {
180+ navigator . clipboard . readText ( ) . then ( ( text ) => {
181+ sendJsonMessage ( {
182+ action : 'terminal' ,
183+ data : { value : text , terminalId }
184+ } ) ;
185+ } ) ;
186+ return false ;
187+ }
188+
163189 return true ;
164190 } ) ;
165191
You can’t perform that action at this time.
0 commit comments