How to change the terminal to the current directory in visual studio code ? (hotkey)

Dimitri Williams picture Dimitri Williams · Apr 13, 2019 · Viewed 33.1k times · Source

In class we had a hotkey for using the terminal with the currently choosen directory. I fixed an issue now with the debugger and everything seems to run smoothly now. Yet, what hotkey fixes this issue?

Answer

VonC picture VonC · Oct 9, 2019

With VSCode 1.39 (Sept. 2019), no more plugin needed.
You now can "Open new terminals with custom working directories"

There is a new command that allows the creation of terminals with a custom current working directory (cwd):

{
  "key": "cmd+shift+h",
  "command": "workbench.action.terminal.newWithCwd",
  "args": {
    "cwd": "${fileDirname}"
  }
}

You can create your own keyboard shortcuts to open new terminals in any number of handy working directories.
The cwd value can either be a normal path or a variable.