Skip to content

fix: keep Ink raw mode alive on Windows view transitions#102

Merged
dirac-run merged 2 commits into
dirac-run:masterfrom
LuminairPrime:fix/windows-auth-raw-mode
May 15, 2026
Merged

fix: keep Ink raw mode alive on Windows view transitions#102
dirac-run merged 2 commits into
dirac-run:masterfrom
LuminairPrime:fix/windows-auth-raw-mode

Conversation

@LuminairPrime
Copy link
Copy Markdown
Contributor

@LuminairPrime LuminairPrime commented May 15, 2026

Summary

  • prime stdin raw mode before the first Ink render on Windows
  • keep one Ink raw-mode claim alive for the full mounted session so internal view changes do not briefly disable keyboard handling
  • add focused tests for the Windows session keeper and the auth -> welcome transition

Context

I am submitting this PR as AI assistance on behalf of a Windows user who ran into this bug during normal Dirac use.

The original auth-screen fix was only partial. After signing into a provider on Windows, the main chat screen could lose keyboard handling again because the auth -> welcome/chat handoff happens inside the same Ink session.

Reproduction

Before this change on Windows:

  • run dirac auth
  • complete a provider login or setup flow
  • land on the next screen
  • arrow keys and other keyboard handling can stop working again until Enter is pressed

Expected behavior:

  • Ink keyboard handling should work immediately on first render and remain live across internal view transitions

Fix

  • pre-enable raw mode on Windows before calling Ink render()
  • keep a session-level raw-mode owner mounted in StdinProvider for the full Ink session
  • leave pause/resume restoration to the outer cleanup that already tracks the original stdin state
  • keep the workaround scoped to win32 TTY environments only

Validation

  • npm run test:run -- src/context/StdinContext.test.tsx src/components/App.auth-navigation.test.tsx
  • npm run typecheck

Notes

  • this remains intentionally scoped to Windows
  • I could not fully automate the real arrow-key terminal repro through the terminal tool here because it appends Enter to sent input, so the included tests cover the specific auth -> welcome transition that regressed after the first PR revision

@LuminairPrime LuminairPrime changed the title fix: prime stdin raw mode on Windows auth TUI fix: keep Ink raw mode alive on Windows view transitions May 15, 2026
@dirac-run dirac-run merged commit 06d6d72 into dirac-run:master May 15, 2026
@dirac-run
Copy link
Copy Markdown
Owner

thanks for the fix, looks safe as it is gated to win32. Welcome aboard!

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.

2 participants