[bug]Restore native Windows interactive prompts#1396
Open
stale2000 wants to merge 1 commit into
Open
Conversation
Windows does not expose the Unix /dev/tty device, so the shared interactive gate was treating native Windows terminals as non-interactive. Move prompt terminal opening behind small platform-specific helpers and route login plus commit-link prompts through that helper. Constraint: Keep existing Unix /dev/tty behavior and CI/agent/test non-interactive guards intact. Constraint: Windows console input and output use documented CONIN$ and CONOUT$ devices. Rejected: Use a runtime.GOOS branch inside CanPromptInteractively | would leave prompt readers able to drift back to hardcoded terminal paths. Rejected: Use bare CON for Windows | less explicit than the documented input/output console devices. Confidence: medium Scope-risk: narrow Reversibility: clean Directive: Keep prompt detection and prompt I/O on the shared OpenPromptTTY helper so platform behavior stays consistent. Tested: mise run lint Tested: go test ./cmd/entire/cli/interactive Tested: go test ./cmd/entire/cli/strategy Tested: go test ./cmd/entire/cli -run 'Test.*Login|TestRunLogin|TestWaitForEnter' Tested: GOOS=windows GOARCH=amd64 go test -c ./cmd/entire/cli/interactive ./cmd/entire/cli/strategy ./cmd/entire/cli via separate output binaries Not-tested: Native Windows terminal manual interaction. Not-tested: mise run check fails in existing TestRunAuthStatus_RendersSessionsTable date expectation (expected 2026-01-01; rendered 2026-01-31). Entire-Checkpoint: e9454c377138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Entire Logs: https://entire.io/gh/stale2000/cli/session/019eaad9-6a88-78a0-94c4-0fe99696aefa
Summary
This fixes native Windows interactive prompt detection. The CLI previously treated Windows terminals as non-interactive because
interactive.CanPromptInteractively()always tried to open/dev/tty, which only exists on Unix-like systems.login.waitForEnter()and the commit-link prompt path also depended on the same Unix terminal assumption.Bug and impact
On native Windows,
/dev/ttydoes not exist. That meantCanPromptInteractively()returnedfalseeven when a real user was running Entire from an interactive PowerShell, Command Prompt, or Windows Terminal session.The practical effect is that Windows users could be pushed into non-interactive fallback behavior by mistake. Flows that rely on prompts could skip choices, auto-select defaults, or fail with non-interactive messages instead of asking the user. Affected areas include login browser confirmation, setup/configuration choices, review/fix pickers, and git-hook commit-link confirmations.
How to reproduce
On native Windows before this change:
interactive.CanPromptInteractively(), for example a prompt-based setup/configuration path orentire login./dev/ttyprobe fails.A minimal code-level reproduction is to call
interactive.CanPromptInteractively()in a native Windows console withoutENTIRE_TEST_TTY=1; it returnsfalsebecauseos.OpenFile("/dev/tty", ...)cannot succeed on Windows.Fix
The fix centralizes prompt-terminal opening behind
interactive.OpenPromptTTY():/dev/ttybehavior.CONIN$for input andCONOUT$for output.CanPromptInteractively(),login.waitForEnter(), andaskConfirmTTY()now use the shared helper instead of hardcoding/dev/tty.This keeps the existing CI, agent subprocess, and test guards intact while making native Windows terminals prompt-capable again.
Verification
mise run lintgo test ./cmd/entire/cli/interactivego test ./cmd/entire/cli/strategygo test ./cmd/entire/cli -run 'Test.*Login|TestRunLogin|TestWaitForEnter'\n-GOOS=windows GOARCH=amd64 go test -c ./cmd/entire/cli/interactive -o /tmp/entire-interactive-windows.test.exe\n-GOOS=windows GOARCH=amd64 go test -c ./cmd/entire/cli/strategy -o /tmp/entire-strategy-windows.test.exe\n-GOOS=windows GOARCH=amd64 go test -c ./cmd/entire/cli -o /tmp/entire-cli-windows.test.exe\n\n## Not tested\n\n- Manual interaction in a native Windows terminal.\n-mise run checkcurrently fails on an unrelated date-sensitiveTestRunAuthStatus_RendersSessionsTableexpectation (2026-01-01expected,2026-01-31rendered).\n