help command: only use $BROWSER if it is a valid command

(plus add Google Chrome and Chromium to graphical_browsers and a spelling fix)
This commit is contained in:
David Adam (zanchey) 2013-05-23 12:20:40 +08:00 committed by ridiculousfish
parent cfe815135e
commit 3a4a2a6dac

View file

@ -22,11 +22,11 @@ function help --description 'Show help for the fish shell'
# Find a suitable browser for viewing the help pages. This is needed
# by the help function defined below.
#
set -l graphical_browsers htmlview x-www-browser firefox galeon mozilla konqueror epiphany opera netscape rekonq
set -l graphical_browsers htmlview x-www-browser firefox galeon mozilla konqueror epiphany opera netscape rekonq google-chrome chromium-browser
set -l text_browsers htmlview www-browser links elinks lynx w3m
if test $BROWSER
# User has manualy set a preferred browser, so we respect that
if type $BROWSER >/dev/null
# User has manually set a preferred browser, so we respect that
set fish_browser $BROWSER
# If browser is known to be graphical, put into background