skip to Main Content

I want to use the VS Code breadcrumbs bar(the bar just below the file name bar) to open a terminal with specific path quickly, like right-click, ctrl-click or other keybinding shortcuts. Is it possible? Is there other way to open a terminal with specific path quickly?

I searched the settings in VS Code code navigation, but didn’t get what I want.

2

Answers


  1. Chosen as BEST ANSWER

    Relating to @starball 's suggestion, there exists a default(maybe) keybinding shortcut cmd K + P(MacOS) to copy the path of the active file.

    {
      "key": "cmd+k p",
      "command": "workbench.action.files.copyPathOfActiveFile"
    }
    

  2. I’m not aware of a way with breadcrumbs, but there are at least two workarounds:

    • Right click the folder/directory in the Explorer View and then click "Open in Integrated Terminal". This may be easier to find if you have the explorer.autoReveal setting left at its default value of true. For this workaround, you might also be interested in this feature-request: https://github.com/microsoft/vscode/issues/67711.

    • Use the File: Copy Path of Active File command in the command palette (or whatever keybinding it is bound to. I think the default is ctrl/cmd+p). Then paste that into a cd command in your shell.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search