[英]How to open file using vscode terminal?
I want to open a new tab and open a file using vscode
terminal.我想打开一个新选项卡并使用
vscode
终端打开一个文件。
like open somefile.js
command, so I can use ls
and open file quickly.比如
open somefile.js
命令,所以我可以使用ls
快速打开文件。
使用code -r <file>
在最后一个活动代码窗口中打开文件
use使用
code -r <filename>
just remeber to install the code command to PATH
.请记住将代码命令安装到
PATH
。 in VScode, open the command palette and type "code", you should see a Shell Command: Install code to PATH option.在 VScode 中,打开命令面板并键入“code”,您应该会看到一个 Shell 命令:将代码安装到 PATH 选项。
I really haven't actually seen any difference between using the command without the -r
flag.我真的没有看到使用没有
-r
标志的命令之间的任何区别。
If you are already in VSCode terminal (not an external OS terminal), check out the latest VSCode 1.64 (Jan. 2022) Terminal shell integration<\/strong><\/a> :如果您已经在 VSCode 终端(不是外部 OS 终端)中,请查看最新的 VSCode 1.64(2022 年 1 月)
终端外壳集成<\/strong><\/a>:
<\/blockquote>
Link support relative to the cwd相对于 cwd 的链接支持<\/h2>
Since we know the
cwd<\/code><\/strong> for each line in the terminal buffer, we can support opening links in the terminal relative to the cwd at the location where it was activated<\/strong> .
由于我们知道终端缓冲区中每一行的
cwd<\/code><\/strong> ,我们可以支持在终端中打开相对于 cwd 被激活位置的链接<\/strong>。
Before, when a link was clicked, a quick pick would open with results from any folders containing a match for that name.以前,当单击链接时,将打开一个快速选择,其中包含与该名称匹配的任何文件夹中的结果。
Now, the exact file match will be opened.现在,将打开完全匹配的文件。
In a terminal with a
cwd<\/code> of VSCode,
package.json<\/code> is echoed.
在具有 VSCode 的
cwd<\/code>的终端中,会回显
package.json<\/code> 。
Clicking on the file name will result invscode\/package.json<\/code> opening.
单击文件名将打开
vscode\/package.json<\/code> 。
<\/blockquote>"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.