You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VSCode.exe via interop in /mnt subdirectory blocks WSL and new VSCode windows #1397
Launching VSCode with the current directory WSL while in a /mnt Windows directory spawns a process the blocks the WSL terminal. This also prevents me from being able to open new VSCode windows from the Windows environment. I presume this is because the interop functionality has wrapped this process to provide PIDs and such, which blocks the Windows GUI from launching the program.
I can Control+C to stop the "VSCode process" in WSL and the VSCode app persists on the Windows side. However, I'm unable to launch new VSCode windows from my shortcuts or Windows Explorer context menus until I fully close out the VSCode process launched by WSL.
Expected results
I expect launching VSCode from WSL to function more like a shortcut, whereby I can invoke it on whatever current directory I'm looking at in WSL, and it launches VSCode without blocking my app or tracking PIDs or interfering with my ability to launch new VSCode windows from the Windows environment. I expect to be able to pass *NIX style absolute and relative paths to VSCode.exe as arguments and have them open upon initial load. I expect to be able to seemlessly switch back and forth between WSL and Windows Explorer and launch as many VSCode windows as I want.
Actual results (with terminal output if applicable)
Some notes I have after running through your scenario:
The behavior of VSCode not launching additional windows is an implementation detail of VSCode. I tried this locally and even from Windows I'm only able to open one VSCode window - so this is by design.
The behavior of GUI applications blocking input from the console is fairly standard in Linux. For example launching firefox from the terminal will block until firefox is closed. You can get around this by launching things in the background by adding a '&' at the end of your command. For example "notepad.exe &"
I expect to be able to pass *NIX style absolute and relative paths to VSCode.exe as arguments and have them open upon initial load
This one is more complicated. In order for the NT version of VSCode to launch using Linux paths one of two things would have to happen:
VSCode would have to have built in logic to understand WSL file paths.
FWIW, VSCode backgrounds on Linux, unlike say firefox. That's just the user-experience they chose. As does Sublime Text and Atom.
There is an interesting Electron bug here that blocked VSCode until they worked around the issue. It raises differences in the way "graphic apps" in Windows vs. Linux treat stdout, stdin and stderr. Electron apps have a lesser known environment variable ELECTRON_RUN_AS_NODE which caused one of your brethren a lot of grief. Node of course is fundamentally CLI.
Interop on environment variables is another fun topic, by the way. Also I think there might be a third way to the path problem, but first I want to see if I can make it work myself ;).
Closing this issue as we have made updates to how VS Code is launched from WSL that should resolve this. Please re-open if you are still experiencing this issue on a more recent build of WSL/VS Code.
Activity
benhillis commentedon Nov 21, 2016
Thanks for trying out interop!
Some notes I have after running through your scenario:
This one is more complicated. In order for the NT version of VSCode to launch using Linux paths one of two things would have to happen:
therealkenc commentedon Nov 25, 2016
FWIW, VSCode backgrounds on Linux, unlike say firefox. That's just the user-experience they chose. As does Sublime Text and Atom.
There is an interesting Electron bug here that blocked VSCode until they worked around the issue. It raises differences in the way "graphic apps" in Windows vs. Linux treat
stdout,stdinandstderr. Electron apps have a lesser known environment variableELECTRON_RUN_AS_NODEwhich caused one of your brethren a lot of grief. Node of course is fundamentally CLI.Interop on environment variables is another fun topic, by the way. Also I think there might be a third way to the path problem, but first I want to see if I can make it work myself ;).
tara-raj commentedon Jul 31, 2018
Closing this issue as we have made updates to how VS Code is launched from WSL that should resolve this. Please re-open if you are still experiencing this issue on a more recent build of WSL/VS Code.