gh-146458: Fix repl height and width tracking on resize#146459
gh-146458: Fix repl height and width tracking on resize#146459GabrielvMarinho wants to merge 4 commits intopython:mainfrom
Conversation
|
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 |
…undant UnixConsole line
29dca79 to
47c7453
Compare
|
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 |
|
The CI is failing. Example: |
47c7453 to
1e7907a
Compare
|
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 |
1e7907a to
42dd0de
Compare
|
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 |
|
If possible, try to avoid |
I had to git push --force some few times because i was rebasing, so its preferable to merge and do a new commit to get to the new state of the main? |
Yes, merge is preferred. Rebase is also causing troubles in reviews. |
Thanks for the heads up, let me know if you need any help on the code review process. |
vstinner
left a comment
There was a problem hiding this comment.
LGTM. unix_console and window_console generates "resize" events. Before, the window_console didn't update the console height and width. Now, the code is generic in Reader.refresh().
|
You may add a NEWS entry to describe the fix. |
I just added it, is it OK that way? |
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
getheightwidthweren't actually returning a tuple with the height and width, so I changed it by adding theside_effectkeyword 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.