Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Send to TerminalNew to Visual Studio Code? Get it now.
Send to Terminal

Send to Terminal

Babak K. Shandiz

|
1,796 installs
| (1) | Free
Send data/text/selection from editor to terminal/shell as environment variables
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Send to Terminal (VS Code Extension)

Send text selection(s) or entire active file as environment variables into a new shell/terminal. With the default configurations, the text sent is assigned to an environment variable named $VALUE.

Examples

Send selection to a new terminal

  1. Make any selection in the editor.

  2. Open commands list (Ctrl+Shift+P).

  3. Type in Send to Terminal: Send selection and press Enter or Return. A new terminal opens with the command template:

    echo -E "$VALUE" | cat
    
  4. Modify the command as you wish.

⚠️ If there were more than one selection (e.g., by having multi-cursor selections or by selecting all occurrences of a text/pattern), you can access them via $VALUE_0, $VALUE_1, and so on.

Send active file to a new terminal

  1. Bring the tab you need to send to terminal. It's not required to save it beforehand.

  2. Open commands list (Ctrl+Shift+P).

  3. Type in Send to Terminal: Send active file and press Enter or Return. A new terminal opens with the command template:

    echo -E "$VALUE" | cat
    
  4. Modify the command as you wish.

Contribution

Please feel free to contribute by submitting PR or opening new issues on the repository and discuss problem or new features. 🍏

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft