VSCode:如何找到我的工作区文件夹 [英] VSCode: How do I find what my workspace folder is
问题描述
是否有一个简单的命令可以告诉我我的工作区文件夹是什么?我在终端中尝试了 ${workspaceFolder}
但没有奏效.
Is there a simple command that will tell me what my workspace folder is? I tried ${workspaceFolder}
in the terminal but that didn't work.
推荐答案
我目前想到的替代方案:
Alternatives that currently come to my mind:
1.) 如果你想在标题栏中看到工作区文件夹,你可以调整 window.title
设置(工作区或用户设置):
1.) If you want to see the workspace folder in the titlebar, you could adjust window.title
setting (workspace or user settings):
"window.title": "${dirty}${activeEditorShort}${separator}${folderPath}${separator}${appName}"
此处可以使用多个变量 - 请参阅默认值 -> 窗口.标题.${folderPath}
最适合我,如果您更喜欢绝对工作区路径.
Multiple variables can be used here - see Defaults -> window.title. ${folderPath}
works best for me, if you prefer the absolute workspace path.
2.) 定义一个可以在终端打印您的工作区文件夹的任务:
2.) Define a task that can print your workspace folder at the terminal:
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo ${workspaceFolder}"
}
]
3.) <代码>文件 ->另存为工作区实际上应该显示当前工作区文件夹(虽然似乎与Windows/Mac不一致)
3.) File -> save as workspace
should actually show the current workspace folder (seems to be not consistent with Windows/Mac though)
4.) 只需打开终端并查看您的 cwd
.我不确定,是否所有终端都默认为工作区文件夹.
4.) Just open the terminal and look at your cwd
. I am not sure, if all terminals default to the workspace folder.
这篇关于VSCode:如何找到我的工作区文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!