Skip to content

babakks/vscode-send-to-terminal

Repository files navigation

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. 🍏

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published