Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@ builds:
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
hooks:
post:
- mkdir -p dist/bin/{{ .Os }}/{{ .Arch }}
- cp {{ .Path }} dist/bin/{{ .Os }}/{{ .Arch }}/orun
- cp {{ .Path }} dist/bin/{{ .Os }}/{{ .Arch }}/orun{{ .Ext }}

archives:
- id: orun-archive
ids:
- orun
formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
Expand Down
3 changes: 1 addition & 2 deletions cmd/orun/command_run_background.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os/exec"
"path/filepath"
"strings"
"syscall"

"github.com/sourceplane/orun/internal/ui"
)
Expand Down Expand Up @@ -54,7 +53,7 @@ func startBackgroundRun(execID string, color bool) error {
"ORUN_EXEC_ID="+execID,
"ORUN_NO_COLOR=1",
)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.SysProcAttr = backgroundSysProcAttr()

if err := cmd.Start(); err != nil {
logFile.Close()
Expand Down
11 changes: 11 additions & 0 deletions cmd/orun/command_run_background_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build unix

package main

import "syscall"

// backgroundSysProcAttr puts the detached run in its own process group so a
// signal to the launching terminal does not reach it.
func backgroundSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setpgid: true}
}
11 changes: 11 additions & 0 deletions cmd/orun/command_run_background_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build windows

package main

import "syscall"

// backgroundSysProcAttr starts the detached run in a new process group so a
// Ctrl+C in the launching console does not reach it.
func backgroundSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP}
}
Loading