Skip to content

bryceremick/send_selection_to_terminal_extension

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published