-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to go-tty for better portabiliy
reinstall signal handler and proc rework TX sender
- Loading branch information
Showing
8 changed files
with
274 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package sitlgen | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
"syscall" | ||
) | ||
|
||
func proc_start(args ...string) (p *os.Process, err error) { | ||
if args[0], err = exec.LookPath(args[0]); err == nil { | ||
var procAttr os.ProcAttr | ||
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr} | ||
procAttr.Sys = &syscall.SysProcAttr{Foreground: false, Setsid: true} | ||
p, err := os.StartProcess(args[0], args, &procAttr) | ||
if err == nil { | ||
return p, nil | ||
} | ||
} | ||
return nil, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package sitlgen | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
func proc_start(args ...string) (p *os.Process, err error) { | ||
if args[0], err = exec.LookPath(args[0]); err == nil { | ||
var procAttr os.ProcAttr | ||
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr} | ||
p, err := os.StartProcess(args[0], args, &procAttr) | ||
if err == nil { | ||
return p, nil | ||
} | ||
} | ||
return nil, err | ||
} |
Oops, something went wrong.