bastion 0.57.0
ci / personal-data (push) Successful in 4s
ci / test (push) Successful in 4m30s
ci / fuzz (push) Successful in 3m25s

This commit is contained in:
Privatae
2026-10-28 20:35:45 +00:00
parent 4012da0b75
commit 081763a675
26 changed files with 2118 additions and 37 deletions
+19
View File
@@ -0,0 +1,19 @@
//go:build !windows
package main
import (
"io"
"os"
)
// openControllingTerminal opens /dev/tty, this process's controlling terminal
// whatever its standard input is. It fails with no terminal (a service, a
// pipe from `ssh host cmd` without -t, cron).
func openControllingTerminal() (io.Reader, io.Writer, func(), error) {
f, err := os.OpenFile("/dev/tty", os.O_RDWR, 0)
if err != nil {
return nil, nil, nil, errNoTerminal
}
return f, f, func() { _ = f.Close() }, nil
}