fix(tui): gate clampStdoutDimensions behind WSL detection (#35738) - #35766
Closed
irandoku wants to merge 1 commit into
Closed
fix(tui): gate clampStdoutDimensions behind WSL detection (#35738)#35766irandoku wants to merge 1 commit into
irandoku wants to merge 1 commit into
Conversation
…ch#35738) clampStdoutDimensions() patches process.stdout via Object.defineProperty, which breaks TUI layout in Warp terminal (status bar and input prompt merge onto one line). Warp's process.stdout is not a standard Node TTY stream, so the property descriptor override changes how Ink reads terminal dimensions in alt-screen mode. Gate the call behind WSL environment detection (WSL_DISTRO_NAME / WSL_INTEROP) so the patch only runs where it's needed — WSL is the environment that reports bogus dimensions (e.g. 131072x1). Fixes NousResearch#35738
Collaborator
This was referenced May 31, 2026
Contributor
|
Thanks for the focused Warp/WSL investigation. This is an automated hermes-sweeper review; the targeted behavior is already absent from current
|
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.
Problem
clampStdoutDimensions()(PR #35657) patchesprocess.stdoutviaObject.definePropertyto guard against bogus terminal dimensions (e.g. WSL's 131072×1). However, this breaks TUI layout in Warp terminal — the status bar and input prompt merge onto one line.Root cause: Warp's
process.stdoutis not a standard Node TTY stream. TheObject.definePropertyoverride changes how Ink reads terminal dimensions, causing the FlexBox layout insideAlternateScreento miscalculate vertical space allocation.Confirmed: WezTerm and other standard terminals are unaffected. Commenting out
clampStdoutDimensions()fixes Warp.Fixes #35738
Fix
Gate
clampStdoutDimensions()behind WSL environment detection so it only runs where needed:Why this works:
WSL_DISTRO_NAME/WSL_INTEROPare always set → function runs → bogus 131072×1 is clamped ✅process.stdoutuntouched → layout works correctly ✅process.stdoutremains the canonical object everywhereTesting
WSL_DISTRO_NAMEclampStdoutDimensionsRisk assessment
Minimal. The change is a 3-line conditional guard around an existing function. The function itself is unchanged. The only behavioral difference is that it no longer runs on non-WSL environments — which is the intended fix.
Cross-validated with Codex (GPT-5.5) which confirmed the approach is sound and identified that alternative approaches (replacing
process.stdoutwith a proxy) would break Ink'sinstances.get(process.stdout)identity lookup.