question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open in Windows Terminal doesn't open in the correct folder when Windows Terminal is already open

See original GitHub issue

Issue Type: Bug

To reproduce:

  1. specify settings
{
    "terminal.explorerKind": "external",
    "terminal.external.windowsExec": "wt"
}
  1. add a folder to the workspace (FWIW I used $HOME/Downloads)
  2. open Windows Terminal
  3. right-click a file and choose Open in Windows Terminal
  4. a new tab is opened in C:\Windows\System32 instead of the expected folder ($HOME/Downloads in this case)

VS Code version: Code - Insiders 1.67.0-insider (a9288be67bab4e9c4dbe62207f01fafc2bdaadcb, 2022-04-15T05:16:11.219Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

Extensions: none

A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30422396
pythontb:30258533
pythonvspyt551:30291412
pythonptprofiler:30281269
vsdfh931cf:30280410
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
pythonvspyt200:30323110
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30449409
pythonvspyt640:30438691
vscscmwlcmt:30465136
pynewfile477:30451556

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
zadjii-msftcommented, Jun 9, 2022

Okay, I know this doesn’t sound like it, but I think we’re tracking this in https://github.com/microsoft/terminal/issues/5506.

That’s the one I’m generally using for “when a commandline is given to an existing window, make sure to evaluate it’s startingDirectory relative to the CWD the commandline was already run in”.

1reaction
zadjii-msftcommented, Jun 9, 2022

Hmm okay I see what’s going on here. You’re spawning wt -d . in c:\whatever. When this works, it’s because Terminal is evaluating . as relative to the Terminal’s own CWD, which is c:\whatever.

If you’ve got useAnyExisting set, then that commandline will get handed off to the existing Terminal window. That window probably has a different CWD, so . won’t work right.

I know we’re tracking this in a couple places on our repo, I’ll find them after lunch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Terminal Troubleshooting
Set your WSL distribution to start in the home ~ directory when launched in older versions of Windows Terminal.
Read more >
How to open the Windows Terminal (Preview) in File Explorer
Simply type in wt in the address bar and it will open the command prompt with the path to your current folder already...
Read more >
A Guide to Customising the Windows Terminal - freshman.tech
Additionally, you can right click on a directory in File Explorer and select “Open in Windows Terminal”. This will launch Windows Terminal ...
Read more >
Integrated Terminal in Visual Studio Code
Note: Open an external terminal with the Ctrl+Shift+C keyboard shortcut if ... are similar to file links but will open a new VS...
Read more >
Top 5 Ways to Fix Windows Terminal Not Opening on ...
1. Use Alternative Methods to Launch Windows Terminal · 2. Ensure Windows Terminal Is Not Disabled · 3. Repair or Reset the Windows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found