VSCode: How do I find what my workspace folder is

后端 未结 2 1600
误落风尘
误落风尘 2021-01-14 03:05

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.

2条回答
  •  滥情空心
    2021-01-14 03:08

    Alternatives that currently come to my mind:

    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}"
    

    Multiple variables can be used here - see Defaults -> window.title. ${folderPath} works best for me, if you prefer the absolute workspace path.

    2.) Define a task that can print your workspace folder at the terminal:

        "tasks": [
            {
                "label": "echo",
                "type": "shell",
                "command": "echo ${workspaceFolder}"
            }
        ]
    

    3.) File -> save as workspace should actually show the current workspace folder (seems to be not consistent with Windows/Mac though)

    4.) Just open the terminal and look at your cwd. I am not sure, if all terminals default to the workspace folder.

提交回复
热议问题