You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
togo new treats redirected stdin (/dev/null, NUL) as interactive and auto-starts docker compose #4
isInteractive() in cmd/new.go checks os.ModeCharDevice on stdin. /dev/null on Linux and macOS, and NUL on Windows, are character devices too. So redirecting stdin doesn't make the command non-interactive.
The prompts themselves use term.IsTerminal and fall back to their defaults. With --db supabase|postgres|togo-postgres|mysql|mongodb and Docker on PATH, provisionDatabase takes the Confirm(..., true) default and runs docker compose up -d.
Reproduction
togo new acc --db supabase --frontend nextjs </dev/null
# → runs `docker compose up -d` in ./acc
This was seen during the v0.2.33 acceptance run (#3). On that machine the run failed harmlessly: Docker had no free address pools, and it left no containers or networks behind.
Expected
When stdin is not a terminal (CI or scripted use), togo new should not provision Docker on its own.
A likely fix is for isInteractive() to use term.IsTerminal(int(os.Stdin.Fd())), as internal/ui already does. That would also affect the interactive feature, frontend and database selection when stdin is redirected, so it needs its own tests.
Fixed in #18, released in v0.2.37. isInteractive() now uses term.IsTerminal(int(os.Stdin.Fd())), so /dev/null, NUL, files and pipes are non-interactive: togo new uses defaults and flags and no longer offers or runs docker compose up -d. Covered by TestIsInteractive_RedirectedStdin.
Activity
fadymondy commentedon Oct 14, 2026
Fixed in #18, released in v0.2.37.
isInteractive()now usesterm.IsTerminal(int(os.Stdin.Fd())), so/dev/null,NUL, files and pipes are non-interactive:togo newuses defaults and flags and no longer offers or runsdocker compose up -d. Covered byTestIsInteractive_RedirectedStdin.