A shorter path
from select to paste.
Everything you need to copy terminal output automatically in VS Code.
Install Terminal Copy On Select
In VS Code, open the Extensions view, search for Terminal Copy On Select by HoutanRocky, and select Install. You can also open the listing directly:
Prefer the command line? With the code command installed, run:
code --install-extension HoutanRocky.terminal-copy-on-selectFor VSCodium or another compatible editor, there is currently no published Open VSX listing. You can build a VSIX from source and use Extensions: Install from VSIX. The extension requires VS Code 1.97 or a compatible API version.
Copy your first terminal selection
- Open Terminal → New Terminal in VS Code.
- Run a command with some harmless output, such as
echo hello. - Drag across
helloin the integrated terminal. - Paste into an editor or another app using your normal paste shortcut.
There is no extra copy action. The setting applies to the integrated terminal, rather than editor selections or the Debug Console. If it does not work immediately, run Developer: Reload Window from the Command Palette and check the setting below.
Understand copyOnSelection
The extension enables a setting that is already built into VS Code:
{
"terminal.integrated.copyOnSelection": true
}To inspect it, open Settings and search for terminal.integrated.copyOnSelection. You can also open your User Settings JSON and add the property above.
The extension preserves explicit User, Workspace, and Workspace Folder values, including false. If a workspace overrides your user setting, review the Workspace tab to choose the behavior for that project.
You can enable this native setting yourself without installing the extension. The extension is a convenience for enabling it when unset and keeping it in your extension setup.
Read more in the official VS Code terminal selection guide.
PowerShell, bash, zsh, and beyond
Because the behavior belongs to VS Code’s integrated terminal, it does not require a shell plugin or changes to your shell profile. Use it with PowerShell, Command Prompt, bash, zsh, fish, or a WSL terminal.
For SSH, WSL, or Dev Containers, check the applicable Remote and Workspace settings if copying behaves differently from a local window. Clipboard copying is handled by the editor’s terminal implementation.
Using Vim, tmux, or a mouse-aware application?
Some terminal apps capture mouse gestures. VS Code documents Alt-drag as a way to force selection; macOS behavior can depend on terminal mouse settings. See the selection documentation for details.
Disable automatic terminal copying
Turn off Terminal › Integrated: Copy On Selection in Settings, or set:
{
"terminal.integrated.copyOnSelection": false
}The extension respects your explicit choice on future starts. The setting is saved in VS Code, so uninstalling or disabling the extension does not reset it. Set it to false if you want automatic copying to stop.
Still need a hand? Visit the support page.