[PR #4021] Fix a crash when calling SetConsoleScreenBufferSize in conpty #25605

Open
opened 2026-01-31 09:10:34 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/4021

State: closed
Merged: Yes


Summary of the Pull Request

Fixes the bug @DHowett-MSFT found in conpty. Before conpty, this check was all one statement. With the addition of conpty, that statement was moved into a "am I not headless" check, to not restrict the conpty size based on the window size. However, the "is the user trying to resize the buffer smaller than the viewport" should have been done outside the headless check. This just splits that statement up.

PR Checklist

Validation Steps Performed

Ran the tiny repro program Dustin provided - we no longer crash.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/4021 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Fixes the bug @DHowett-MSFT found in conpty. Before conpty, this check was all one statement. With the addition of conpty, that statement was moved into a "am I not headless" check, to not restrict the conpty size based on the window size. However, the "is the user trying to resize the buffer smaller than the viewport" should have been done outside the headless check. This just splits that statement up. ## PR Checklist * [x] Closes #3907 * [x] I work here * [ ] I didn't add tests, since that's being tracked in #3941 * [n/a] Requires documentation to be updated ## Validation Steps Performed Ran the tiny repro program Dustin provided - we no longer crash.
claunia added the pull-request label 2026-01-31 09:10:34 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25605