Skip to content

Commit

Permalink
fix: start child in session
Browse files Browse the repository at this point in the history
We're getting some weird waitid errors. Doing a little bit of digging,
it looks like we maybe want Setsid instead of pgid. I tested this
against yarn and we weren't seeing the issue with pgid, so I removed
that from the exceptions
  • Loading branch information
mloberg committed May 17, 2024
1 parent 5947339 commit 53b2021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func run(ctx context.Context, name string, args, env []string, l *slog.Logger) i
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if !lo.Contains([]string{"sh", "bash", "zsh", "fish", "yarn"}, name) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
if !lo.Contains([]string{"sh", "bash", "zsh", "fish"}, name) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
}

if err := cmd.Start(); err != nil {
Expand Down

0 comments on commit 53b2021

Please sign in to comment.