Paste Image to Terminal
Save a clipboard screenshot directly to disk and insert the file path into the active VS Code terminal — with one keystroke.
Supports Windows (Snipping Tool / Win+Shift+S) and macOS (Cmd+Ctrl+Shift+4 / Cmd+Shift+4).
Requirements
| Platform |
Requirement |
| Windows |
PowerShell (built-in on Windows 7+) |
| macOS |
osascript (built-in on all macOS versions) |
VS Code 1.75.0 or later is required.
Installation
Install the .vsix package via the terminal:
code --install-extension paste-image-terminal-0.0.1.vsix
Or open the Extensions view (Ctrl+Shift+X), click the ··· menu, and choose Install from VSIX….
Usage
- Press Win+Shift+S to capture a region (the image is copied to the clipboard).
- Click inside an open VS Code terminal panel.
- Press Ctrl+Alt+V.
- The image is saved and its path is inserted at the terminal cursor.
macOS — Screenshot
- Press Cmd+Ctrl+Shift+4 to capture a region to the clipboard.
- Alternatively, press Cmd+Shift+4, draw the region, then hold Ctrl before releasing to copy instead of saving.
- Click inside an open VS Code terminal panel.
- Press Ctrl+Alt+V.
- The image is saved and its path is inserted at the terminal cursor.
Tip: Press Enter after the path is inserted to run whatever command you've typed, or use insertMode: runCommand (see Settings) to have the extension run the command for you automatically.
Settings
Open File → Preferences → Settings and search for pasteImage.
| Setting |
Type |
Default |
Description |
pasteImage.outputPath |
string |
(workspace root) |
Folder where screenshots are saved. Falls back to the system temp directory when no workspace is open. |
pasteImage.filenamePrefix |
string |
"screenshot" |
Prefix for generated filenames, e.g. screenshot-20260422-153045.png. |
pasteImage.insertMode |
"insertPath" | "runCommand" |
"insertPath" |
insertPath — paste the path only (no Enter). runCommand — automatically run a command with the path. |
pasteImage.runCommand |
string |
(platform default) |
Command to run against the image path when insertMode is runCommand. Defaults to cat on macOS and type on Windows. |
Example: always save to a specific folder
{
"pasteImage.outputPath": "/Users/me/screenshots",
"pasteImage.filenamePrefix": "snap"
}
Example: auto-open the image with imgcat (iTerm2 / supported terminals)
{
"pasteImage.insertMode": "runCommand",
"pasteImage.runCommand": "imgcat"
}
Keybinding
The default keybinding is Ctrl+Alt+V (active only when a terminal is focused).
To change it, open File → Preferences → Keyboard Shortcuts (Ctrl+K Ctrl+S), search for Paste Image to Terminal, and assign your preferred key combination.
Troubleshooting
"No image found in clipboard"
Make sure you copied a screenshot (not a file, text, or URL). On Windows, use Win+Shift+S or Snipping Tool and verify the notification confirms the screenshot was copied. On macOS, hold Ctrl during capture to copy to clipboard instead of saving to Desktop.
Path is inserted but my command fails
Check that pasteImage.outputPath points to a folder that exists and is writable. If the setting is empty, the workspace root is used.
Nothing happens when I press Ctrl+Alt+V
The terminal panel must be focused (click inside it first). If another extension has claimed the same keybinding, open Keyboard Shortcuts and reassign.
macOS: osascript error about clipboard type
The clipboard does not contain a PNG image. Some apps copy a file reference rather than image data — try using Cmd+Ctrl+Shift+4 (region to clipboard) instead of Cmd+Shift+4 (region to file).
License
MIT