mirror of
https://github.com/golang/go
synced 2024-11-02 13:21:55 +00: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
1 changed files with 4 additions and 1 deletions
|
@ -23,7 +23,10 @@ func Commands() [][]string {
|
|||
case "windows":
|
||||
cmds = append(cmds, []string{"cmd", "/c", "start"})
|
||||
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,
|
||||
[]string{"chrome"},
|
||||
|
|
Loading…
Reference in a new issue