You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_pyrepl: Mangled input when sys.ps1 is wider than terminal width #159658
In 3.16 (main), if the prompt (sys.ps1) is wider than the terminal width, typing characters results in a mangled line and an unexpected backslash.
Reproducer
Open a narrow terminal:
xterm -geometry 20x10
Start Python 3.16 in it, then set a long prompt:
importsyssys.ps1="a"*64+" "
Type Hello.
Actual behavior
The prompt wraps to the next physical line, but _pyrepl seems to miscalculate the layout. It inserts a stray \ and splits the first character from the rest:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa H \
ello
Activity
nsyhykui commentedon Oct 18, 2026
I found a similar issue on Python 3.14, but it looks much worse. like this: