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

Opening URLs can freeze terminal (X11 but no GUI browser) #1475

Open
neiljp opened this issue Mar 5, 2024 · 0 comments · May be fixed by #1483
Open

Opening URLs can freeze terminal (X11 but no GUI browser) #1475

neiljp opened this issue Mar 5, 2024 · 0 comments · May be fixed by #1483

Comments

@neiljp
Copy link
Collaborator

neiljp commented Mar 5, 2024

I've observed this behavior when:

  • the DISPLAY variable is set (eg. when using ssh -X to a remote system)
  • the remote system does not have a GUI web browser installed

Currently our URL-handling function has an explicit check for DISPLAY, and avoids opening the URL if it does not find it (on Linux), with an error message.

With DISPLAY set, for a terminal in a GUI (or by ssh -X), we allow the python webbrowser module to find a browser. In my case it only finds a text-only browser installed (links), which it attempts to run in the same terminal, which likely interacts badly with the urwid loop.

A possible way to reproduce this would be to run on a remote environment or one with no GUI browsers installed, and either connect using something like ssh -X (X forwarding), or explicitly set DISPLAY to trick the detection into thinking a GUI is present.

One possible solution is to manually stop and start the urwid loop, as occurs in #1394. However, currently I don't see a straightforward (documented) way using webbrowser to determine if it is a GUI or text web-browser. That means that a challenge with this approach, if it resolves the issue, is that for users within a GUI, this may leaves the ZT UI unusable until the browser returns/closes. This wasn't an issue for #1394, as the assumption is one is composing separately, and in most cases the editor temporarily replaces the ZT window.

@neiljp neiljp changed the title Opening URLs can freeze terminal (X11 but no GUI browser?) Opening URLs can freeze terminal (X11 but no GUI browser) Mar 10, 2024
@Sushmey Sushmey linked a pull request Apr 15, 2024 that will close this issue
18 tasks
Sushmey added a commit to Sushmey/zulip-terminal that referenced this issue Apr 15, 2024
Temporarily unsetting TERM environ so text-browsers aren't detected.

This results in an exception which displays an error for text-browsers.

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

Successfully merging a pull request may close this issue.

1 participant