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

fish_config web interface not loading #7158

Closed
succerror opened this issue Jun 27, 2020 · 6 comments
Closed

fish_config web interface not loading #7158

succerror opened this issue Jun 27, 2020 · 6 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@succerror
Copy link

succerror commented Jun 27, 2020

fish_config is opening a tmp file on the browser but fails to start the web server

fish, version 3.1.2
OS: Arch Linux x86_64
Kernel: 5.6.13-arch1-1
Terminal: rxvt-unicode-256color
BROWSER env: firefox-developer-edition
python: Python 3.6.8

Steps to reproduce the problem:

$ sudo pacman -S fish
$ fish
$ fish_config

This will open a tmp file file:///tmp/web_configsomehashhere.html on the browser(here firefox-developer-edition) which is supposed to Meta Refresh to a local web server but it just keeps loading.

I've figured the issue is with this line responsible for opening the browser which is not returning until the browser is closed and blocking the web server from handing the request.

I've tried changing the code to open browser in a separate thread using threading lib and it worked.

@succerror succerror changed the title fish_config web interface not loading fish_config web interface not loading Jun 27, 2020
@faho
Copy link
Member

faho commented Jun 28, 2020

If that line is blocking, then your system is misconfigured. This ordinarily does not block, so you should make it so your system doesn't.

I'd check e.g. $BROWSER.

@faho faho added the question label Jun 28, 2020
@succerror
Copy link
Author

If remote browsers are not available on Unix, the controlling process will launch a new browser and wait

I found this in here https://docs.python.org/3/library/webbrowser.html

Looks like the behavior of webbrowser.open is different for different situations

Below is for firefox-developer-edition

  • If the browser window is already open, it exits after opening a tab
  • If the browser is not open at all, it opens a browser window and waits until its closed

I noticed same behaviour in newly installed manjaro with palemoon browser

@faho
Copy link
Member

faho commented Jun 28, 2020

Okay, it seems like you're not using a "remote browser" (what an awful term). You should..

You're doing the equivalent of calling firefox --no-remote, which is just more annoying for everyone involved.

(note: If this was in any way common, we could be hacking around it. But since it's not, you should instead fix your config)

@succerror
Copy link
Author

succerror commented Jun 28, 2020

You're doing the equivalent of calling firefox --no-remote

No I'm not. In fact the problem is when there is no browser running at all.
I think remote browsers means a browser which can accept remote commands.
And if there is no browsers running, then there is no remote browser available.

FYI:

~ > cat (which (echo $BROWSER))
#!/bin/sh
exec /usr/lib/firefox-developer-edition/firefox "$@"

If I manually open the browser before running fish_config, it works as expected.

Does that means that the user need to have the browser open before running fish_config? I don't think they have to.

@faho
Copy link
Member

faho commented Jun 28, 2020

Does that means that the user need to have the browser open before running fish_config? I don't think they have to.

So, when I do

python -c 'import webbrowser; webbrowser.open("https://www.python.org")'

This opens firefox, even if it is not running, and the python process exits. This is how I've always known it and we've not gotten any other bug reports about it.

In your case, that's broken, for some reason. Possibly because of configuration in your browser. That would have to be fixed.

@faho
Copy link
Member

faho commented Jun 28, 2020

Ahahahaha, yeah, it's a firefox-developer-edition thing (meaning it'll possibly show up in newer firefoxen)

Yeah, we have to work around this. Blergh

@faho faho closed this as completed in 5c22be5 Jun 28, 2020
@faho faho added bug Something that's not working as intended and removed question labels Sep 29, 2020
@faho faho added this to the fish 3.2.0 milestone Sep 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants