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

Extra quotes cause browser to not pop up on jupyter notebook command #248

Closed
gitgithan opened this issue Oct 27, 2022 · 3 comments · Fixed by lewagon/setup#419
Closed

Extra quotes cause browser to not pop up on jupyter notebook command #248

gitgithan opened this issue Oct 27, 2022 · 3 comments · Fixed by lewagon/setup#419
Assignees

Comments

@gitgithan
Copy link

image
echo $BROWSER shows the path in double quotes. There's no new tab popping up in chrome.

I had to manually delete the single quotes wrapping the double quotes in zshrc, after that the tab pops up on jupyter notebook and echo $BROWSER shows the path without double quotes.

Another issue is the >> append did not append to a new line, but appended to a previous block of lines that were commented out, so the echo was treated as a comment and did not take effect, i had to manually arrange it to the new line

@julesvanrie
Copy link
Contributor

This one is still happening. Windows setup to be precise. All users had it today (6).

Removing single quotes indeed solved the problem.

@gmanchon
Copy link
Contributor

slack thread

@julesvanrie
Copy link
Contributor

Spent a bit more time on this (many Windows laptops in my batch).

The problem only occurs when a BROWSER env variable is added to .zshrc.

In the setup, we export BROWSER only for gh, not for jupyter. Later, when students setup dotfiles, we don't have the export BROWSER anymore. On some laptops this works fine (mine doesn't need BROWSER and opens my browser nicely when using gh browse and jupyter notebook. But on some students' laptops this doesn't work, and they need BROWSER to be set. If then the line is used as during the setup, it doesn't work because of the extra quotes.

Underlying problem is that gh and jupyter notebook expect the path in a different format:

  • gh needs export BROWSER="'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'" (mind the extra quotes)
  • jupyter notebook needs export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" (no extra quotes)

Fortunately gh now supports an env variable called GH_BROWSER, which has higher prio than BROWSER.

So, adding the following to .zshrc seems to always work:

# Browser
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
export GH_BROWSER="'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'"

Could be useful to add this to the end of the setup?
Or, in the first part of the setup, where BROWSER is exported for use by gh, maybe replace it with GH_BROWSER to avoid confusion.

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

Successfully merging a pull request may close this issue.

4 participants