-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Pasting long line in new REPL causes text to appear after >>> #123177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmm, can someone reproduce this on recent main? Is this Mac-specific? I can't reproduce this on Linux. |
I cannot reproduce exactly this, but there is something weird happening with macOS terminal application (I could not reproduce this with iTerm): Screen.Recording.2024-08-23.at.14.20.38.mov |
This seems partially related to the cache but not fully. Removing the line cache shows the following problem: Screen.Recording.2024-08-23.at.14.34.00.mov |
For some reason this only happens in the terminal app and not in iterm |
Another problem: seems like the cache forces lines that warp around to also start with |
@godlygeek could you take a look at this if you have some free cycles? |
When I type random words like that as soon as I get to the end of the line I see strange behaviour including Screen.Recording.2024-08-23.at.9.39.44.AM.mov |
What terminal are you using? |
Can you try if #123267 fixes the other problem for you? |
The default "Terminal" |
Can you run |
|
Seems like there's two separate issues here, one with how Apple Terminal behaves when something is written to the last column of a line, and one with the cache. I understand what's causing the cache bug, but I'm still deciding how best to fix it. |
The apple terminal one it's being handled here: #123267 |
…des in the new REPL (pythonGH-123267) (cherry picked from commit fdb3f9b) Co-authored-by: Pablo Galindo Salgado <[email protected]>
When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line.
#123324 fixes the cache bug, and adds a test to exercise prompts with wrapping. |
When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line.
) When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line. (cherry picked from commit 602fcf9) Co-authored-by: Matt Wozniski <[email protected]>
…123327) gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324) When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line. (cherry picked from commit 602fcf9) Co-authored-by: Matt Wozniski <[email protected]>
Thanks for the report @Siecje and @godlygeek for the fix! |
Bug report
Bug description:
When I paste code that is one line and my REPL window is small the text that would not be shown because it is offscreen is displayed after pressing enter.
For example I am pasting
After I paste and then press enter to create the object I see
I can't remove the text or use the arrow keys to navigate the letters since the >>> prompt is empty.
When the window is smaller more text is shown after
>>>
.CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: