Fix terminal instantly quitting by clamping initial POSIX terminal pty dimensions#313698
Open
kangarko wants to merge 1 commit intomicrosoft:mainfrom
Open
Fix terminal instantly quitting by clamping initial POSIX terminal pty dimensions#313698kangarko wants to merge 1 commit intomicrosoft:mainfrom
kangarko wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Clamps the initial PTY dimensions passed to node-pty on non-Windows platforms to avoid spawning a PTY with invalid cols/rows (eg 0x0) which can trigger early ioctl(2) failed, EBADF failures and cause the integrated terminal to exit immediately (notably on macOS arm64 Insiders).
Changes:
- Clamp initial
colsandrowsto at least1for POSIX PTY spawn options. - Preserve Windows behavior (including the existing Git Bash delayed-resize path that relies on
0x0).
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.
Fixes #313694
Relates to #313693
This clamps the initial pty dimensions passed to node pty on non Windows platforms.
TerminalProcess.resize()already clampscolsandrowsto at least1, but the initial spawn options still receive the constructor values directly. In the macOS arm64 Insiders regression, the terminal process can become ready, immediately hit a resize path withioctl(2) failed, EBADF, and exit before the shell starts.This keeps Windows startup behavior unchanged, including the existing Git Bash delayed resize path, and only normalizes the POSIX spawn options.
Validation I ran locally on the affected Insiders install:
stty sizeandttyreturn valid outputzshlaunchesI also made a separate user side workaround script for people stuck on the broken Insiders build, but that is intentionally not part of this PR.