gh-75512: Keep the prompt with the input in progress when a thread prints in the IDLE Shell - #157706
Conversation
…ead prints in the IDLE Shell Output written while a prompt is shown was inserted after the newline which marks the prompt, so the statement being entered lost it. Now the prompt mark is moved after the output.
|
Fail. Late output causes the prompt to disappear until I finish line and hit Enter. Copied with prompts (spaces ignored). After |
|
Thanks, reproduced. The sidebar is redrawn while the output is inserted, before the prompt tag is re-added, so the prompt only came back on the next line-count change. Fixed by updating the sidebar after moving the tag (as |
terryjreedy
left a comment
There was a problem hiding this comment.
Definite improvement. People should send async output as complete lines.
To test this further I should merge and use it.
|
Thanks @serhiy-storchaka for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-157835 is a backport of this pull request to the 3.15 branch. |
|
GH-157836 is a backport of this pull request to the 3.14 branch. |
|
GH-157837 is a backport of this pull request to the 3.13 branch. |
…read prints in the IDLE Shell (GH-157706) (#157837) gh-75512: Keep the prompt with the input in progress when a thread prints in the IDLE Shell (GH-157706) Output written while a prompt is shown was inserted after the newline which marks the prompt, so the statement being entered lost the prompt. If the output ends with a newline, the prompt is moved to the next line. (cherry picked from commit 89c67a9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…read prints in the IDLE Shell (GH-157706) (#157836) gh-75512: Keep the prompt with the input in progress when a thread prints in the IDLE Shell (GH-157706) Output written while a prompt is shown was inserted after the newline which marks the prompt, so the statement being entered lost the prompt. If the output ends with a newline, the prompt is moved to the next line. (cherry picked from commit 89c67a9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
The Shell sidebar shows the prompt on the line after a newline tagged
console. Output which arrives while a prompt is shown (for example from a thread) was inserted after that newline, so the output got the prompt and the statement being entered lost it. Now the tag is moved from that newline to the last newline of the output, so the prompt stays with the input in progress. Unterminated output shares the line with the input until its newline arrives, as in a terminal.🤖 Generated with Claude Code