gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width#140333
Conversation
… line hits console width
…ed px_pos variable" This reverts commit 742096d.
This reverts commit bb87563.
|
@chris-eibl I've added tests for this. |
|
Thank you for the review! Added the second blurb. |
chris-eibl
left a comment
There was a problem hiding this comment.
Lgtm. This is now ready for core dev review. Thank you for your contribution.
…letion suggestion line hits console width (pythonGH-140333) (cherry picked from commit e13f6dc) Co-authored-by: Tan Long <tanloong@foxmail.com>
|
Sorry, @tanloong and @ambv, I could not cleanly backport this to |
|
GH-145871 is a backport of this pull request to the 3.14 branch. |
…letion suggestion line hits console width (pythonGH-140333) (cherry picked from commit e13f6dc) Co-authored-by: Tan Long <tanloong@foxmail.com>
|
Sorry @tanloong and @ambv, I had trouble completing the backport. |
|
Sorry, @tanloong and @ambv, I could not cleanly backport this to |
…le completion suggestion line hits console width (pythonGH-140333) (cherry picked from commit e13f6dc) Co-authored-by: Tan Long <tanloong@foxmail.com>
|
GH-145872 is a backport of this pull request to the 3.13 branch. |
|
This skips handling the wrapping in
self.__write_changed_line()whenwlen(newline)==self.width, and simply updates self.posxy (explained in #140131 (comment)).One thing that happens after the skip is that the cursor moves leftward by one character on Tab key:
WindowsTerminal_eDpHfMhTvA.mp4
As noted in this comment, "when writing to the final character on the line, the cursor location is effectively moved one element backwards." So, we account for this 1-character offset by setting the cursor column to a maximum of self.width-1.
WindowsTerminal_0fSumUhJoh.mp4