Skip to content

gh-146458: Fix repl height and width tracking on resize#146459

Open
GabrielvMarinho wants to merge 2 commits intopython:mainfrom
GabrielvMarinho:fix-repl-height-and-width-tracking-on-resize
Open

gh-146458: Fix repl height and width tracking on resize#146459
GabrielvMarinho wants to merge 2 commits intopython:mainfrom
GabrielvMarinho:fix-repl-height-and-width-tracking-on-resize

Conversation

@GabrielvMarinho
Copy link

@GabrielvMarinho GabrielvMarinho commented Mar 26, 2026

On windows, the resize event should be triggering an update in the console height and width, however this is not happening.

I noticed the Unix console didn't have this problem, it was updating fine. My suggestion to fixing this is taking the resizing logic from both console implementations and let it at the reader level, that way it will update both (Unix and windows).

After adding this change, the resizing was happening:

fixed-repl-video.mp4

The tests then started failing as the Magic Mocks to getheightwidth weren't actually returning a tuple with the height and width, so I changed it by adding the side_effect keyword and sending a lambda with the values. With that addition, the tests are actually testing if the resize is happening, if you comment out the height and width resizing logic, they will fail.

@python-cla-bot
Copy link

python-cla-bot bot commented Mar 26, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 26, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@GabrielvMarinho GabrielvMarinho force-pushed the fix-repl-height-and-width-tracking-on-resize branch from 29dca79 to 47c7453 Compare March 26, 2026 23:19
@bedevere-app
Copy link

bedevere-app bot commented Mar 26, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@GabrielvMarinho GabrielvMarinho marked this pull request as ready for review March 27, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant