-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Add workbench.action.terminal.sendSignal command #250672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
@copilot compile errors:
|
…lasses Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
... Fixed all compilation errors by implementing the missing Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
const instance = accessor.get(ITerminalService).activeInstance; | ||
if (instance) { | ||
const signal = isObject(args) && 'signal' in args ? toOptionalString(args.signal) : undefined; | ||
if (!signal) { | ||
return; | ||
} | ||
instance.sendSignal(signal); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should show a quick pick with all possible signals when there is no argument provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added signal quick pick when no argument is provided. The command now shows a list of 9 common POSIX signals with descriptions when invoked without arguments. See commit 31db9c4.
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
const signalOptions: IQuickPickItem[] = [ | ||
{ label: 'SIGINT', description: 'Interrupt process (Ctrl+C)' }, | ||
{ label: 'SIGTERM', description: 'Terminate process gracefully' }, | ||
{ label: 'SIGKILL', description: 'Force kill process' }, | ||
{ label: 'SIGSTOP', description: 'Stop process' }, | ||
{ label: 'SIGCONT', description: 'Continue process' }, | ||
{ label: 'SIGHUP', description: 'Hangup' }, | ||
{ label: 'SIGQUIT', description: 'Quit process' }, | ||
{ label: 'SIGUSR1', description: 'User-defined signal 1' }, | ||
{ label: 'SIGUSR2', description: 'User-defined signal 2' } | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide another option after a separator "Manually enter signal" which provides a text input to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added separator and manual signal input option to the signal picker. When no argument is provided, users can now select from predefined signals or choose "Manually enter signal" to provide a custom signal name. See commit b9db1ff.
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR adds a new
workbench.action.terminal.sendSignal
command that allows sending arbitrary signals to the terminal's foreground process, similar to howworkbench.action.terminal.sendSequence
allows sending arbitrary text sequences.Changes
The implementation follows the exact same pattern as the existing
sendSequence
command:SendSignal
toTerminalCommandId
enum and registered the action with proper metadataterminalSendSignalCommand
function that validates signal argument and callsinstance.sendSignal()
sendSignal
method throughout the terminal stack:ITerminalInstance
andTerminalInstance
ITerminalProcessManager
andTerminalProcessManager
ITerminalChildProcess
and implementations (TerminalProcess
,ExtHostPseudoterminal
)IPtyService
andPtyService
SendSignal
to remote terminal channel for remote development scenariossendSignal
methodUsage
Users can now create keybindings to send signals:
Common signals include:
SIGINT
- Interrupt (like Ctrl+C)SIGTERM
- Terminate gracefullySIGKILL
- Force killSIGSTOP
- Stop processSIGCONT
- Continue processImplementation Notes
kill(signal)
method that supports arbitrary POSIX signalssendSequence
Fixes #250671.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.github.com
node ./lib/postinstall.js
(dns block)http://168.63.129.16:80/machine/
/usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.