firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
214 stars 38 forks source link

Starting a new browser instance blocks mutt #85

Closed clwgg closed 5 years ago

clwgg commented 5 years ago

Hi, I have a problem, where opening a link through urlscan blocks the terminal mutt is running in, if no browser was running before (i.e. opening the link started a new browser instance). If a browser is running already and the link is opened as a new tab, the terminal is not blocked.

I suspect this is not the expected behavior, but I can't seem to figure out what's going wrong. Any help would be appreciated.

Some more info on my system:

firecat53 commented 5 years ago

Interesting...I never noticed that before because I use a small wrapper script that launches either GUI or text browser depending on if I'm in X or not. I also always have my browser open, so I never saw the difference in behavior with the browser initially closed. After some research, Mutt doesn't handle backgrounding applications that are launched from the .mailcap or things like urlscan.

In any case, this wrapper script should work for you (edit your desired browser). export BROWSER=browser.sh in your .bashrc or .profile or .bash_profile.

#!/bin/bash
# Chooses default CLI or GUI browser

browser_cli="elinks"
browser="qutebrowser"

if [ -z "$DISPLAY" ]; then
    eval "$browser_cli" "$@" &> /dev/null &
else
    eval "$browser" "$@" &> /dev/null &
fi
clwgg commented 5 years ago

Cool, that works -- thanks a lot for the help!