dyne / JaroMail

Terminal UI email client to download, filter, search and archive messages off-line
https://dyne.org/software/jaro-mail
GNU General Public License v3.0
103 stars 9 forks source link

rewrite browser detection #27

Closed parazyd closed 7 years ago

parazyd commented 7 years ago

I've experienced issues in the way browser detection was handled before. Only the first browser would be tried and (not) detected for some reason. This commit fixes the behaviour and works when jaro update is issued and some other browser than elinks is installed.

hellekin commented 7 years ago

FWIW I use this in my .zshrc that might be useful (i.e., using the builtin command)

any_executable() {
    local x xbin
    for x in $* ; do
        xbin=$(builtin which "$x")
        (( $? )) && continue
        [[ -x $xbin ]] || continue
        break
    done
    echo -n "$xbin"
}

# Applications
setopt ALL_EXPORT
BROWSER=$(any_executable conkeror luakit firefox chromium-browser
elinks2 w3m lynx curl wget)

Then you can switch on that.

parazyd commented 7 years ago

Fixed itself with ZSH 5.3 I guess... Closing.