Repository navigation
Commit 539707c
gh-145448: Fix REPL tab completion cursor position in pending wrap state
When __write_changed_line writes to the last column of the terminal,
the cursor enters "pending wrap" state where it physically stays at
width-1. However, posxy was recording width, causing subsequent CUB
(Cursor Backward) calculations to overshoot by one cell.
Cap posxy x-coordinate at width-1 to match the physical cursor
position in pending wrap state. This fixes the cursor moving backward
during tab completion in xterm and Ghostty.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 66eafc9 commit 539707c
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- Lib/_pyrepl
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
| 678 | + | |
| 679 | + | |
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
| |||
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | | - | |
| 690 | + | |
| 691 | + | |
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
| |||
713 | 715 | | |
714 | 716 | | |
715 | 717 | | |
716 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
717 | 726 | | |
718 | 727 | | |
719 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments