@@ -139,13 +139,39 @@ export const terminalSendSequenceCommand = async (accessor: ServicesAccessor, ar
139
139
140
140
export const terminalSendSignalCommand = async ( accessor : ServicesAccessor , args : unknown ) => {
141
141
const instance = accessor . get ( ITerminalService ) . activeInstance ;
142
- if ( instance ) {
143
- const signal = isObject ( args ) && 'signal' in args ? toOptionalString ( args . signal ) : undefined ;
144
- if ( ! signal ) {
142
+ if ( ! instance ) {
143
+ return ;
144
+ }
145
+
146
+ let signal = isObject ( args ) && 'signal' in args ? toOptionalString ( args . signal ) : undefined ;
147
+
148
+ if ( ! signal ) {
149
+ const quickInputService = accessor . get ( IQuickInputService ) ;
150
+
151
+ const signalOptions : IQuickPickItem [ ] = [
152
+ { label : 'SIGINT' , description : 'Interrupt process (Ctrl+C)' } ,
153
+ { label : 'SIGTERM' , description : 'Terminate process gracefully' } ,
154
+ { label : 'SIGKILL' , description : 'Force kill process' } ,
155
+ { label : 'SIGSTOP' , description : 'Stop process' } ,
156
+ { label : 'SIGCONT' , description : 'Continue process' } ,
157
+ { label : 'SIGHUP' , description : 'Hangup' } ,
158
+ { label : 'SIGQUIT' , description : 'Quit process' } ,
159
+ { label : 'SIGUSR1' , description : 'User-defined signal 1' } ,
160
+ { label : 'SIGUSR2' , description : 'User-defined signal 2' }
161
+ ] ;
162
+
163
+ const selected = await quickInputService . pick ( signalOptions , {
164
+ placeHolder : localize ( 'selectSignal' , 'Select signal to send to terminal process' )
165
+ } ) ;
166
+
167
+ if ( ! selected ) {
145
168
return ;
146
169
}
147
- instance . sendSignal ( signal ) ;
170
+
171
+ signal = selected . label ;
148
172
}
173
+
174
+ instance . sendSignal ( signal ) ;
149
175
} ;
150
176
151
177
export class TerminalLaunchHelpAction extends Action {
0 commit comments