mirror of
https://github.com/golang/go
synced 2024-11-18 13:44:48 -07:00
cmd/internal/browser: use xdg-open only from a desktop session
xdg-open's man page says: > xdg-open is for use inside a desktop session only. Use the DISPLAY environment variable to detect this. Updates #19131. Change-Id: I3926b3e1042393939b2ec6aacd9b63ac8192df3b Reviewed-on: https://go-review.googlesource.com/37390 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
731fd009f0
commit
d580972d59
@ -23,7 +23,10 @@ func Commands() [][]string {
|
|||||||
case "windows":
|
case "windows":
|
||||||
cmds = append(cmds, []string{"cmd", "/c", "start"})
|
cmds = append(cmds, []string{"cmd", "/c", "start"})
|
||||||
default:
|
default:
|
||||||
cmds = append(cmds, []string{"xdg-open"})
|
if os.Getenv("DISPLAY") != "" {
|
||||||
|
// xdg-open is only for use in a desktop environment.
|
||||||
|
cmds = append(cmds, []string{"xdg-open"})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmds = append(cmds,
|
cmds = append(cmds,
|
||||||
[]string{"chrome"},
|
[]string{"chrome"},
|
||||||
|
Loading…
Reference in New Issue
Block a user