Skip to content

Commit

Permalink
web--browse: support /usr/bin/cygstart on Cygwin
Browse files Browse the repository at this point in the history
While both GUI and console Cygwin browsers do exist, anecdotal evidence
suggests most users rely on their native Windows browser.  cygstart,
which is a long-standing part of the base Cygwin installation, will
cause the page to be opened in the default Windows browser (the one
registered to open .html files).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Yaakov Selkowitz authored and Junio C Hamano committed Jun 21, 2013
1 parent c0add30 commit cc2f6b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Documentation/git-web--browse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following browsers (or commands) are currently supported:
* dillo
* open (this is the default under Mac OS X GUI)
* start (this is the default under MinGW)
* cygstart (this is the default under Cygwin)

Custom commands may also be specified.

Expand Down
11 changes: 8 additions & 3 deletions git-web--browse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ valid_custom_tool()
valid_tool() {
case "$1" in
firefox | iceweasel | seamonkey | iceape | \
chrome | google-chrome | chromium | chromium-browser |\
konqueror | opera | w3m | elinks | links | lynx | dillo | open | start)
chrome | google-chrome | chromium | chromium-browser | \
konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
start | cygstart)
;; # happy
*)
valid_custom_tool "$1" || return 1
Expand Down Expand Up @@ -127,6 +128,10 @@ if test -z "$browser" ; then
if test -x /bin/start; then
browser_candidates="start $browser_candidates"
fi
# /usr/bin/cygstart indicates Cygwin
if test -x /usr/bin/cygstart; then
browser_candidates="cygstart $browser_candidates"
fi

for i in $browser_candidates; do
init_browser_path $i
Expand Down Expand Up @@ -174,7 +179,7 @@ konqueror)
;;
esac
;;
w3m|elinks|links|lynx|open)
w3m|elinks|links|lynx|open|cygstart)
"$browser_path" "$@"
;;
start)
Expand Down

0 comments on commit cc2f6b6

Please sign in to comment.