mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 15:07:55 +00:00
portlist: set SysProcAttr.HideWindow on Windows
Prevents annoying shell window flashes when running /server by hand.
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
package portlist
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
exec "tailscale.com/tempfork/osexec"
|
||||
)
|
||||
|
||||
// Forking on Windows is insanely expensive, so don't do it too often.
|
||||
@@ -18,3 +21,9 @@ func listPorts() (List, error) {
|
||||
func addProcesses(pl []Port) ([]Port, error) {
|
||||
return listPortsNetstat("-nab")
|
||||
}
|
||||
|
||||
func init() {
|
||||
osHideWindow = func(c *exec.Cmd) {
|
||||
c.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user