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

Spaces break line in $ENV_VARIABLE #3632

Closed
solesensei opened this issue Oct 24, 2018 · 5 comments
Closed

Spaces break line in $ENV_VARIABLE #3632

solesensei opened this issue Oct 24, 2018 · 5 comments

Comments

@solesensei
Copy link

solesensei commented Oct 24, 2018

Hey, there.
I stucked with same problem as here
Example:

SoleSensei@SoleSurface:~$ $BROWSER
-bash: /mnt/c/Program: No such file or directory
SoleSensei@SoleSurface:~$ export BROWSER='"/mnt/c/Program\ Files/Firefox/firefox.exe"'
SoleSensei@SoleSurface:~$ $BROWSER
-bash: "/mnt/c/Program\: No such file or directory
SoleSensei@SoleSurface:~$ export BROWSER="/mnt/c/Program\ Files/Firefox/firefox.exe"
SoleSensei@SoleSurface:~$ $BROWSER
-bash: /mnt/c/Program\: No such file or directory
SoleSensei@SoleSurface:~$ export BROWSER=/mnt/c/Program\ Files/Firefox/firefox.exe
SoleSensei@SoleSurface:~$ $BROWSER
-bash: /mnt/c/Program: No such file or directory
SoleSensei@SoleSurface:~$ export BROWSER='/mnt/c/Program Files/Firefox/firefox.exe'
SoleSensei@SoleSurface:~$ $BROWSER
-bash: /mnt/c/Program: No such file or directory
SoleSensei@SoleSurface:~$ xdg-open https://github.com
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: /mnt/c/Program: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: /mnt/c/Program: not found
xdg-open: no method available for opening 'https://github.com'

Path just breaks on first space. Any ideas?

_Originally posted by @solesensei in #1766 (comment)

@benhillis
Copy link
Member

You'll need to quote your environment variable usage:
"$BROWSER"

https://superuser.com/questions/616351/spaces-in-linux-environmental-variables

@solesensei
Copy link
Author

solesensei commented Oct 24, 2018

@benhillis, okay, but what about xdg-open and other applications using unquoted environment variables?

@benhillis
Copy link
Member

@solesensei - Their scripts should be updated because they are incorrect. Spaces are not common in Linux paths, but they are not illegal either.

@solesensei
Copy link
Author

okay, thanks, so i'm closing issue. And trying not to use Windows paths with spaces in WLS.

@imadelq
Copy link

imadelq commented Sep 10, 2020

I have used :
export BROWSER='eval "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"'

It worked for me.

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

3 participants