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

Send Selection to Terminal

Bryce Remick

|
1 install
| (1) | Free
Send selected code with file path and line numbers to the integrated terminal
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Send Selection to Terminal

Quickly send file paths and code selections to your integrated terminal with formatted references including line numbers.

Features

This extension provides two commands to streamline your workflow when working with AI assistants, documentation, or command-line tools:

Send Selection to Terminal

Send the current file path with selected line numbers to the terminal in the format @path/to/file.ts#L10-20.

  • Command: Send Selection to Terminal
  • Default Keybinding: Ctrl+L (Windows/Linux) or Cmd+L (macOS)
  • Format: @relative/path/to/file.ext#L{start}-{end}
    • Single line: @src/extension.ts#L42
    • Multiple lines: @src/extension.ts#L10-20

Send File Path to Terminal

Send just the current file path to the terminal in the format @path/to/file.ts.

  • Command: Send File Path to Terminal
  • Default Keybinding: Ctrl+Shift+L (Windows/Linux) or Cmd+Shift+L (macOS)
  • Format: @relative/path/to/file.ext
    • Example: @src/extension.ts

Use Cases

  • Reference code when chatting with AI coding assistants
  • Quickly copy file paths for documentation
  • Create file references for code review comments
  • Share precise code locations with teammates

Usage

  1. Open a file in your workspace
  2. (Optional) Select the lines of code you want to reference
  3. Press the keyboard shortcut or run the command from the Command Palette
  4. The formatted reference appears in your terminal ready to use

The text is sent to the terminal without executing, so you can append it to your current command or use it as needed.

Requirements

  • VS Code version 1.105.0 or higher
  • An active workspace folder

Extension Settings

This extension does not contribute any settings. The keybindings can be customized in your VS Code keyboard shortcuts.

Known Issues

None at this time. Please report issues on the GitHub repository.

Release Notes

0.0.1

Initial release of Send Selection to Terminal:

  • Send file selection with line numbers to terminal
  • Send file path to terminal
  • Configurable keyboard shortcuts

License

MIT

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