Opening web links in the default browser fails silently in a terminal only environment #91
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#91
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is actually the same problem as seen in #49. I'm raising it again because:
This issue is non urgent, has low impact, and is a very long story (sorry about that).
The issue occurs when Bombadillo is being run in a terminal-only environment, and the client is configured to open links in the user's default web browser. When opening a web link, the message "Attempting to open in web browser" is shown but no other action occurs.
This behaviour was explained in #49 - the subprocess for
xdg-open
is started but there's no way for the process to appear on the screen. Also, because it is "working", no error is detected or returned.The workaround was to implement a terminal-based browsing system, which has been proven to be very cool. Further mitigation will also be done in the proposed
webmode
setting by labelling the option asgui
or something similar.As mentioned, the behaviour can still occur in the described situation. There are some additional items which make this seem a little worse:
xdg-open
process starts, but is marked as 'defunct'xdg-open
man page states that it is for use inside a desktop session onlyMaybe there is a way to handle this nicely - detect a defunct process, identify the environment, or execute the command a different way. In this case, a nice error could be returned.
I can't see an uncomplicated, obvious, or non-hacky way to deal with this. I suspect this will just have to be clearly documented, and in this case it would be more than acceptable (imho).
The only way I can figure would be some form of X (x windows) detection. But that only works on a system running x (which should be the vast majority I believe). I'm not sure how to do that.... but if it is doable, we could catch this before sending to xdg-open.
This is partially addressed by #92 (I go into detail there, but the brief version is that a check for
Xorg
is made. If the check errors then messaging is returned to the user rather than trying to open in a browser).There is another rare situation where this issue could appear. This bug talks about using
xdg-open
in a graphical environment, but having it open a terminal application that results in the exact same behaviour.This situation has a workaround. It is not a problem with Bombadillo or the way we are using
xdg-open
, so is not something we should address. Furthermore, I don't think the direction of #92 should be changed by this new information.Wow. That issue and the workaround are both pretty cool. I did not know that was even possible. Really neat. Agreed not something to worry about re: #92
It does bring up the interesting side-quest of
bombadillo.desktop
. If one was created and added as part of the isntall/makefile process then searching for applications in gnome, for example, would show bombadillo as a result. We could even make an icon and folks could put bombadillo on their launcher/bar/tray/menu/whatever. I had not thought about doing so, having been concerned with other things... but it has some appeal.That is a really good idea. It could be a default handler for gopher and gemini links.
I have a branch started for this, but need to work on it a bit more. I'll let you know (or you'll see a PR) once it is ~ready.
This issue is mitigated by checking $DISPLAY, $WAYLAND_DISPLAY, and the presence of an
Xorg
binary on the system. This determines if a GUI environment is available, and from there the appropriate steps to either tryxdg-open
or return an error message.Fixed in #92 !