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

Cli fails to wait for user to input token on WSL #13

Open
unleashit opened this issue Jul 28, 2018 · 4 comments
Open

Cli fails to wait for user to input token on WSL #13

unleashit opened this issue Jul 28, 2018 · 4 comments

Comments

@unleashit
Copy link

On Windows Bash (WSL), after clicking yes to "We will open CodeSandbox" and then yes to "We will open CodeSandbox to finish the login process", it shows a link to the login but the browser doesn't load. It also doesn't work manually as the program exits before allowing the user to input a token.

The browser probably isn't launching because on WSL, windows apps must have .exe appended like chome.exe. I'm able to click on the provided link, log into Github and get a token, but unfortunately I can't input it because the program has already exited.

@unleashit
Copy link
Author

Not just on WSL, just confirmed the prompt doesn't wait for the user to input the token using git bash (on Windows 10) either. Also don't see a way (at least after checking codesandbox --help) to manually save a token.

@unleashit
Copy link
Author

Figured out the problem is with the opn package. It is attempting to spawn a process to cmd.exe, but on WSL it's not in the path by default (at least it wasn't for me). I added it and it now works, although on WSL they should make it use whatever the current shell is instead of hardcoding cmd.exe (assuming that would work).

@AWolf81
Copy link

AWolf81 commented Jan 17, 2019

I'm not sure why this fails but I noticed that it's a node version specific issue.
Node 10.15.0 - browser window not opening & token input not displayed - not exporting
Node 8.15.0 - browser window opens & exporting is working

Tested on Window 10 (64bit) with nvm.

I'll check if this is an issue with opn package.
Tested latest version 5.4.0 with opn-cli and it's opening the browser. I also checked the history and I don't see anything Windows or Node v10 related in opn-cli since 5.1.0

@unleashit
Copy link
Author

unleashit commented Jan 18, 2019

Thanks for the reply. I got it to work by adding cmd to my path within the WSL environment, but IMO opn needs to add support for WSL. Here's the issue I put up over there awhile back: sindresorhus/open#106.

My situation might be a bit less common since I'm stripping the Windows path that gets added by WSL in my .bashrc (due to various problems). But I don't think I'm the only one who does that and I think there's now even a built in option to do that in WSL's config.

edit: perhaps you might consider throwing an Error if opn fails. Right now it fails silently and isn't easy to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants