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
Multi-line input prompt mishandled in REPL #142078
When the input prompt has 1 or more newline characters, the text preceding the last \n is printed again when a character is typed in by the user. Every subsequent character typed in by the user after the second also leads to text preceding the last \n to be reprinted. (i.e., 2 characters inputted -> prompt repeated 1 time, 3 characters inputted -> prompt repeated 2 times, etc.)
This does not occur on 3.12, only 3.13+, and only on the REPL, not when running a script.
A similar issue also occurs when using \t in the input prompt:
>>>input("a\t:")
aa :b'b'
This is slightly different from the newline case - the text is repeated only once regardless of the number of characters in the input.
Activity
TotalyEnglizLitrate commentedon Nov 29, 2025
This seems to be a bug in how the new pyrepl handles escape characters in
sys.ps1(which is used internally in the pyrepl to print prompts for input)2025-11-29.15-26-50.mp4
yihong0618 commentedon Nov 29, 2025
this is the same issue as #127068
and can be fixed in #139465
cc @picnixz
yihong0618 commentedon Nov 29, 2025
checked this change
ps1issue also can fix with the patch, can you help double check it?Thank you very much
picnixz commentedon Nov 29, 2025
Yes it's a duplicate of #127068.