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

Send Open File To Terminal

saltand

|
9 installs
| (0) | Free
Send active file path to VSCode terminal quickly
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Send Open File To Terminal

Visual Studio Marketplace Version Made with reactive-vscode

快速将当前活动文件的路径发送到 VSCode 终端或复制到剪贴板。

功能特性

  • 🚀 将文件路径发送到终端
  • 📋 将文件路径复制到剪贴板
  • 📝 支持选中的代码行范围(格式:@path/to/file.ts#L10-L20)
  • 🔀 优先使用相对路径,如果不在工作区则使用绝对路径
  • ✨ 自动标准化路径分隔符为 /

命令

命令 标题 说明
send-open-file-to-terminal.sendActiveFile Send Active File Path To Terminal 将当前文件路径发送到终端
send-open-file-to-terminal.copyActiveFile Copy Active File Path To Clipboard 将当前文件路径复制到剪贴板

使用方法

方法 1: 命令面板

  1. 打开命令面板(Cmd+Shift+P / Ctrl+Shift+P)
  2. 输入以下命令之一:
    • Send Active File Path To Terminal - 发送到终端
    • Copy Active File Path To Clipboard - 复制到剪贴板

方法 2: 快捷键(可选配置)

你可以在 VSCode 的快捷键设置中为这些命令添加自定义快捷键:

{
  "key": "cmd+shift+t",
  "command": "send-open-file-to-terminal.sendActiveFile"
},
{
  "key": "cmd+shift+c",
  "command": "send-open-file-to-terminal.copyActiveFile"
}

输出格式

  • 无选中内容:@path/to/file.ts
  • 选中单行(第 10 行):@path/to/file.ts#L10
  • 选中多行(第 10-20 行):@path/to/file.ts#L10-L20

Configurations

暂无配置项

Sponsors

License

MIT License © 2022 Anthony Fu

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