Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal.integrated.splitCwd="inherited" is not working on Windows/WSL2 + Multiroot Workspace #127811

Closed
jchang10 opened this issue Jul 1, 2021 · 9 comments · Fixed by #130291
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal General terminal issues that don't fall under another label verified Verification succeeded
Milestone

Comments

@jchang10
Copy link

jchang10 commented Jul 1, 2021

Does this issue occur when all extensions are disabled?: Yes

Version: 1.58.0-insider (user setup)
Commit: 1fc68f3
Date: 2021-07-01T09:30:57.217Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042

Steps to Reproduce:

  1. This error I think only occurs using Workspaces. A single project, the terminals seem to work fine. However,
    with multiple projects, the environment gets confused.
  2. New Terminal (ctrl+shift+`)
  3. Split Terminal

I get this error message: 'The termial process failed to launch: Starting directory (cwd) "\home\username\my\project"'. The first terminal works, but it's the second or subsequent terminal that creates the error.

This is using the VSCode for Windows using WSL Remote. This error has now existed for at least a week in the Insiders edition. I am surprised this has not already been brought up.

I think the error is indicating that its confusing a windows path for a linux path. Because this is using WSL-Remote, the path should be using forward slashes not backslashes for windows.

This happens when "terminal.integrated.splitCwd" is inherited or initial. The workaround is to set this to workspaceRoot, then it works. However, it's annoying not to have inherited or initial working. Also, nowhere in my settings is "cwd" assigned anywhere.

Also there is #121705, but I suspect the issue on MacOS is different.

Jae

@jchang10
Copy link
Author

jchang10 commented Jul 2, 2021

The bottom line: Only while using Workspaces, the first or default terminal is properly run in WSL2. However, any subsequent new terminals are being recognized as a Windows environment, not Linux. Somehow the combination of Workspace+WSL is messing up the terminal environment.

@jchang10 jchang10 changed the title terminal.integrated.splitCwd="inherited" is not working on Windows/WSL2 terminal.integrated.splitCwd="inherited" is not working on Windows/WSL2 + Multiroot Workspace Jul 2, 2021
@jchang10
Copy link
Author

jchang10 commented Jul 2, 2021

I just discovered there is a command called "Create new Integrated terminal (In Active Workspace)"; where as the default "New Terminal" calls "Create new Integrated terminal".

This is another possible workaround. However, you have to make sure the active file is where you want the new terminal to be created. You lose the ability to select which folder to create the new terminal in, unfortunately.

@Tyriar Tyriar self-assigned this Jul 21, 2021
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label labels Jul 21, 2021
@Tyriar
Copy link
Member

Tyriar commented Jul 21, 2021

Can repro:

image

  1. Open multi-root workspace in WSL
  2. ctrl+shift+`
  3. ctrl+shift+5

@Tyriar
Copy link
Member

Tyriar commented Jul 21, 2021

Ah this is happening because we're getting a string instead of a Uri here:

case 'initial':
return instance.getInitialCwd();
case 'inherited':
return instance.getCwd();

@InsidersByte
Copy link

I'm also getting this issue when using inherited for workspaces and remote ssh from a windows to a linux host.

If I reload the window I am able to split the terminal for terminals that were created before the reload.

Version: 1.58.2 (system setup)
Commit: c3f1263
Date: 2021-07-14T22:10:15.214Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.18363

@lukasz-mitka
Copy link

Same here.

Version: 1.59.0 (user setup)
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:13:12.822Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.19042

@spasche
Copy link
Contributor

spasche commented Aug 6, 2021

As a workaround for this issue in version 1.58, I was using this setting:
"terminal.integrated.splitCwd": "workspaceRoot"

But now in version 1.59.0, the issue happens with any terminal.integrated.splitCwd values 😭.

@Tyriar Tyriar added this to the Backlog milestone Aug 9, 2021
@Tyriar Tyriar modified the milestones: Backlog, August 2021 Aug 16, 2021
Tyriar added a commit that referenced this issue Aug 16, 2021
Copy URI authority from base when splitting terminals, fixes #127811
@jchang10
Copy link
Author

Awesome! Just got the fix in insiders! Thank you!

@stuartleeks
Copy link

Verified fixed in

Version: 1.60.0-insider (user setup)
Commit: 5f19eee5dc9588ca96192f89587b5878b7d7180d
Date: 2021-08-24T19:41:58.784Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

@stuartleeks stuartleeks added the verified Verification succeeded label Aug 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal General terminal issues that don't fall under another label verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@spasche @stuartleeks @Tyriar @jchang10 @InsidersByte @meganrogge @lukasz-mitka and others