Skip to content

fix(new): treat redirected stdin as non-interactive - #18

Merged
fadymondy merged 1 commit into
mainfrom
fix/4-stdin-tty
Oct 14, 2026
Merged

fadymondy merged 1 commit into
mainfrom
fix/4-stdin-tty

Conversation

@fadymondy

Copy link
Copy Markdown
Contributor

Fixes #4

isInteractive() used os.ModeCharDevice, which is also set for /dev/null and NUL. It now uses term.IsTerminal(int(os.Stdin.Fd())), matching internal/ui. With redirected stdin, togo new no longer prompts for features/frontend/database and no longer offers or runs docker compose up -d; it uses the defaults and the flags.

Test: TestIsInteractive_RedirectedStdin (devnull/NUL, regular file, pipe) failed before the change and passes now. go vet ./... and go test ./... pass.

🤖 Generated with Claude Code

isInteractive() checked os.ModeCharDevice, which is also set for /dev/null and
NUL, so 'togo new --db postgres </dev/null' still offered and ran
'docker compose up -d'. Use term.IsTerminal like internal/ui does.

Fixes #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadymondy
fadymondy merged commit dc7f522 into main Oct 14, 2026
3 checks passed
@fadymondy
fadymondy deleted the fix/4-stdin-tty branch October 14, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

togo new treats redirected stdin (/dev/null, NUL) as interactive and auto-starts docker compose

1 participant