Skip to content

Commit cc2f6b6

Browse files
yselkowitzgitster
authored andcommitted
web--browse: support /usr/bin/cygstart on Cygwin
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c0add30 commit cc2f6b6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Documentation/git-web--browse.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following browsers (or commands) are currently supported:
3434
* dillo
3535
* open (this is the default under Mac OS X GUI)
3636
* start (this is the default under MinGW)
37+
* cygstart (this is the default under Cygwin)
3738

3839
Custom commands may also be specified.
3940

git-web--browse.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ valid_custom_tool()
3232
valid_tool() {
3333
case "$1" in
3434
firefox | iceweasel | seamonkey | iceape | \
35-
chrome | google-chrome | chromium | chromium-browser |\
36-
konqueror | opera | w3m | elinks | links | lynx | dillo | open | start)
35+
chrome | google-chrome | chromium | chromium-browser | \
36+
konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
37+
start | cygstart)
3738
;; # happy
3839
*)
3940
valid_custom_tool "$1" || return 1
@@ -127,6 +128,10 @@ if test -z "$browser" ; then
127128
if test -x /bin/start; then
128129
browser_candidates="start $browser_candidates"
129130
fi
131+
# /usr/bin/cygstart indicates Cygwin
132+
if test -x /usr/bin/cygstart; then
133+
browser_candidates="cygstart $browser_candidates"
134+
fi
130135

131136
for i in $browser_candidates; do
132137
init_browser_path $i
@@ -174,7 +179,7 @@ konqueror)
174179
;;
175180
esac
176181
;;
177-
w3m|elinks|links|lynx|open)
182+
w3m|elinks|links|lynx|open|cygstart)
178183
"$browser_path" "$@"
179184
;;
180185
start)

0 commit comments

Comments
 (0)