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

WSL: does not run through our CLI script #39892

Closed
spboyer opened this issue Dec 7, 2017 · 15 comments
Closed

WSL: does not run through our CLI script #39892

spboyer opened this issue Dec 7, 2017 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded windows VS Code on Windows issues workbench-os-integration Native OS integration issues WSL Issue when using WSL
Milestone

Comments

@spboyer
Copy link
Member

spboyer commented Dec 7, 2017

https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_19.md#pipe-output-directly-into-vs-code

Version 1.19.0-insider
Commit 3656454
Date 2017-12-07T05:15:37.456Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Using WSL as Terminal.

Steps to Reproduce:

  1. Use WSL as Terminal
  2. ps aux | grep code | code-insiders

Does nothing, just line return. Commands without the | return the expected data in terminal window as expected.

image

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Dec 7, 2017
@bpasero bpasero assigned bpasero and unassigned Tyriar Dec 8, 2017
@bpasero bpasero added info-needed Issue requires more information from poster workbench-os-integration Native OS integration issues and removed terminal General terminal issues that don't fall under another label labels Dec 8, 2017
@bpasero
Copy link
Member

bpasero commented Dec 8, 2017

@spboyer can you run ps aux | grep code | code-insiders --verbose and attach the output? Also maybe share your exact setup with WSL so that I can setup my environment like that.

@Tyriar
Copy link
Member

Tyriar commented Dec 11, 2017

@bpasero do you need the cli to pipe data to VS Code? The CLI is disabled in WSL https://github.com/Microsoft/vscode/blob/29aeb102dc0ea5ebdfda1b96acf26412b8c6cd03/resources/win32/bin/code.sh#L9

@spboyer
Copy link
Member Author

spboyer commented Dec 11, 2017

@bpasero the --verbose flag just freezes the command. If you want to setup your environment like mine, use this setup from @jldeen
bash -c "$(curl -fsSL https://raw.githubusercontent.com/jldeen/dotfiles/wsl/configure.sh)"

@bpasero bpasero changed the title Pipe output directly into vs code - doesn't work for WSL terminal WSL: run through our CLI script Dec 12, 2017
@bpasero bpasero assigned Tyriar and unassigned bpasero Dec 12, 2017
@bpasero bpasero added debt Code quality issues and removed info-needed Issue requires more information from poster labels Dec 12, 2017
@bpasero
Copy link
Member

bpasero commented Dec 12, 2017

@Tyriar yes, we need our CLI and I would actually suggest to try hard to get our CLI to work also for WSL. There are many more things that will likely not work if we do not use CLI, for example --wait.

@bpasero bpasero changed the title WSL: run through our CLI script WSL: does not run through our CLI script Dec 12, 2017
@Tyriar
Copy link
Member

Tyriar commented Dec 12, 2017

microsoft/WSL#1494 (comment) this may work to move the environment over now, not sure about whether the streaming data would work across the wsl/batch boundary though?

@bpasero
Copy link
Member

bpasero commented Dec 13, 2017

@Tyriar why exactly is CLI disabled in WSL?

@Tyriar
Copy link
Member

Tyriar commented Dec 14, 2017

@bpasero

	# If running under WSL don't pass cli.js to Electron as environment vars
	# cannot be transferred from WSL to Windows
	# See: https://github.com/Microsoft/BashOnWindows/issues/1363
	#      https://github.com/Microsoft/BashOnWindows/issues/1494

We need to run electron as node for the CLI. I think there are workarounds for that now though in the comment links.

@bpasero
Copy link
Member

bpasero commented Dec 15, 2017

@Tyriar oh I see, that is odd. So this is only an issue because ELECTRON_RUN_AS_NODE does not end up in Electron? I wonder if there are other ways to tell Electron to run as node, e.g. as command line argument.

@Tyriar
Copy link
Member

Tyriar commented Dec 15, 2017

@bpasero the workarounds suggest a wrapping bat script which sets the env based on cli args: microsoft/WSL#1494 (comment)

./launch_win.sh FOO="bar && rd /s/q %HOMEPATH%\Documents" echo Hello

@bpasero
Copy link
Member

bpasero commented Dec 16, 2017

@Tyriar how would that work though? That script seems to leverage cmd.exe to set the environment but then we would execute Code through the windows system again and we would basically end up not running Code through the WSL? That can only work if the paths we pass on are actually Windows paths and not Linux paths but since we are in bash, all our paths are Linux paths (/mnt/c/...).

@bpasero
Copy link
Member

bpasero commented Dec 17, 2017

@Tyriar actually is sounds like #13138 (comment) is exactly the solution to that problem with a wslpath script.

@bpasero
Copy link
Member

bpasero commented Dec 17, 2017

I filed electron/electron#11455 to have an alternate way of forcing Electron to run as node.

@bpasero bpasero added the WSL Issue when using WSL label Dec 17, 2017
@Tyriar
Copy link
Member

Tyriar commented Dec 18, 2017

@bpasero

then we would execute Code through the windows system again and we would basically end up not running Code through the WSL

Yes, we only support launching the Windows executable via WSL. It is possible to run the Linux version by installing an server but it can be hard to get working and is flaky/weird. AFAIK the console team doesn't recommend launching GUI apps via WSL generally.

actually is sounds like #13138 (comment) is exactly the solution to that problem with a wslpath script

Yeah that's to convert the paths, I didn't move on that because wslpath looked so large (and was python), we'd probably want to roll our own converter in the CLI JS.

@Tyriar Tyriar modified the milestones: March 2018, Backlog Mar 26, 2018
@Tyriar Tyriar added the windows VS Code on Windows issues label Jun 21, 2018
@bpasero
Copy link
Member

bpasero commented Jul 8, 2018

Isn't this fixed?

@Tyriar
Copy link
Member

Tyriar commented Jul 9, 2018

Was merged in May, not the right issue annotation on the PR though #44945

@Tyriar Tyriar closed this as completed Jul 9, 2018
@Tyriar Tyriar modified the milestones: Backlog, July 2018 Jul 9, 2018
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug and removed debt Code quality issues labels Jul 9, 2018
@RMacfarlane RMacfarlane added the verified Verification succeeded label Aug 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 23, 2018
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 verified Verification succeeded windows VS Code on Windows issues workbench-os-integration Native OS integration issues WSL Issue when using WSL
Projects
None yet
Development

No branches or pull requests

4 participants