diff --git a/internal/tui/loopimpl.go b/internal/tui/loopimpl.go index b6ccf1a..0191e64 100644 --- a/internal/tui/loopimpl.go +++ b/internal/tui/loopimpl.go @@ -1085,14 +1085,6 @@ func (e *TermEnv) Sigint() <-chan os.Signal { return sig } -// Sigwinch subscribes to terminal resizes (FR-TUI-P-04) so the loop can -// re-probe the geometry and repaint promptly instead of at the next poll. -func (e *TermEnv) Sigwinch() <-chan os.Signal { - sig := make(chan os.Signal, 1) - signal.Notify(sig, syscall.SIGWINCH) - return sig -} - // SuspendAttach runs `herdr --session agent attach ` with // inherited stdio, exactly what `devagent attach --exec` does // (FR-VIS-02). The resolved pane id is recorded in the orchestration ledger diff --git a/internal/tui/rawterm_other.go b/internal/tui/rawterm_other.go index d529ed2..28abb43 100644 --- a/internal/tui/rawterm_other.go +++ b/internal/tui/rawterm_other.go @@ -2,7 +2,10 @@ package tui -import "errors" +import ( + "errors" + "os" +) // rawTerm is a no-op stub on platforms without the POSIX termios interface: // the interactive loop refuses to start (the non-TTY one-shot path never @@ -16,3 +19,10 @@ func (r *rawTerm) enterRaw() error { return errors.New("raw mode unsupported on func (r *rawTerm) restore() {} func termSize(fd int) (rows, cols int) { return DefaultRows, DefaultColumns } + +// Sigwinch is a stub on platforms without SIGWINCH (Windows). The TermEnv +// contract (loop.go) allows a nil channel: Run's resize select simply never +// fires and the poll path repaints instead. +func (e *TermEnv) Sigwinch() <-chan os.Signal { + return nil +} diff --git a/internal/tui/rawterm_unix.go b/internal/tui/rawterm_unix.go index 002560f..d2180c5 100644 --- a/internal/tui/rawterm_unix.go +++ b/internal/tui/rawterm_unix.go @@ -9,6 +9,8 @@ package tui // syscall — the same IFMIN..IFLAG word layout IoctlGetTermios manages. import ( + "os" + "os/signal" "syscall" "unsafe" ) @@ -78,3 +80,13 @@ func termSize(fd int) (rows, cols int) { } return int(ws.Row), int(ws.Col) } + +// Sigwinch subscribes to terminal resizes (FR-TUI-P-04) so the loop can +// re-probe the geometry and repaint promptly instead of at the next poll. +// Unix-only: syscall.SIGWINCH does not exist on Windows — the TermEnv +// contract (loop.go: may return nil) covers the stub there. +func (e *TermEnv) Sigwinch() <-chan os.Signal { + sig := make(chan os.Signal, 1) + signal.Notify(sig, syscall.SIGWINCH) + return sig +}