diff --git a/docs/terminal/advanced.md b/docs/terminal/advanced.md index d90401093d..2fc25bc6db 100644 --- a/docs/terminal/advanced.md +++ b/docs/terminal/advanced.md @@ -82,7 +82,7 @@ Using mnemonics to access VS Code's menu (for example, `kbstyle(Alt+F)` for File ### Custom sequence keyboard shortcuts -The `workbench.action.terminal.sendSequence` command can be used to send a specific sequence of text to the terminal, including escape sequences that are interpreted specially by the shell. The command enables you to send Arrow keys, `kbstyle(Enter)`, cursor moves, etc. +The `workbench.action.terminal.sendSequence` command can be used to send a specific sequence of text to the terminal, including escape sequences that are interpreted specially by the shell. The command enables you to send Arrow keys, `kbstyle(Enter)`, cursor moves, and more. Run this command via the Command Palette, which allows for manual input, but it's most useful when you assign a custom keyboard shortcut with arguments. For example, the sequence below jumps over the word to the left of the cursor (`kbstyle(Ctrl+Left)`) and then presses `kbstyle(Backspace)`: @@ -103,6 +103,22 @@ The `sendSequence` command only works with the `\u0000` format for using charact * [XTerm Control Sequences](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) * [List of C0 and C1 control codes](https://github.com/xtermjs/xterm.js/blob/0e45909c7e79c83452493d2cd46d99c0a0bb585f/src/common/data/EscapeSequences.ts) +## Send a custom signal + +The `workbench.action.terminal.sendSignal` command can be used to send an arbitrary signal to the foreground process in the active terminal. + +For example, the below keybinding will send `SIGTERM`, causing it to terminate gracefully. + +```jsonc +{ + "key": "ctrl+shift+/", + "command": "workbench.action.terminal.sendSignal", + "args": { + "signal": "SIGTERM" + } +} +``` + ## Confirmation dialogs In order to avoid unnecessary output and user prompts, the terminal does not show warning dialogs when processes exit. If warnings are desirable, they can be configured with the following settings: