visual-studio-codecommand-linecommand-line-arguments

-r (--reuse-window) not working in code command at all


I used a new machine with VSCode for the 1st time. I moved my dev setup there, including EDITOR env var with code -wr. But I noticed e.g. git wasn't opening the file in the same window, unlike on old machine. So I did further debugging and code --reuse-window tsconfig.json doesn't work anywhere at all, I tried it from within VSCode terminal and cmd/pwsh in WezTerm. I also have window.openFilesInNewWindow set to off which makes it even weirder.

What is going on? How to fix it?

As a side note, GitLens rebase interactive editor also isn't launching (just regular text editor instead), even though it's enabled - could be related.


Solution

  • Ok, I found the culprit shortly after, by checking the window more carefully.

    It turns out I had another VSCode installed in the system, for whatever reason - version 1.32.3, in %PROGRAMFILES(X86)%\Microsoft VS Code. I'll update the answer once I find out why it got installed on this fresh system - I used choco, so it could be a bug in their recipe.

    Deleting C:\Program Files (x86)\Microsoft VS Code\bin from %PATH% system env fixed the issue. So would do uninstalling the redundant version.