Repository navigation
fix(tui): clean up controlling input on guard setup errors - #571
Merged
Merged
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by free · Input: 28.5K · Output: 2.5K · Cached: 149.6K |
This was referenced Oct 24, 2026
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.
Issue for this PR
Refs #441
Type of change
What does this PR do?
Narrow post-merge follow-up to #570 review findings F2/F3. If raw-hook assignment or timer setup throws after opening CONIN$, guard setup now restores/cleans up before propagating the error. Guard installation is moved inside the lifecycle cleanup try so its failure also closes the resolved terminal stream. Normal successful guard behavior is unchanged.
The invalid-handle fixture now uses 0xffffffffffffffff, the float64 representation bun:ffi returns for INVALID_HANDLE_VALUE on x64, instead of the nonrepresentative -1 fixture. The production comparison was already correct.
#441 stays open for actual Windows console/editor acceptance. These tests model boundaries and do not raise a real CTRL_C_EVENT or establish Windows runtime success.
How did you verify your code works?
Bun1.3.14/Linux: helper+editor16passed/54assertions; lifecycle failure+stdin routing+launcher policy7passed/24assertions. Focused helper/new-test TypeScript check passes. Full local package typecheck is not claimed; exact-head CI and independent review remain required.
Tests execute actual transpiled product sources. New raw-setter and timer-throw regressions fail on pre-fix product code (2failures); the lifecycle guard-install failure regression also fails on pre-fix code (source cleanup count0 instead of1). Restoring fixes returns all green. No existing assertion removed, timeout changed or skip added.
Win32 API contract source: https://learn.microsoft.com/en-us/windows/console/console-handles . The CreateFile CONIN$ handle is independent of redirected standard input. Actual FFI/console behavior remains unverified locally.
Screenshots / recordings
No Windows console screenshot available; runtime acceptance remains outstanding.
Checklist