Don't repaint the screen when an interrupt is pending - #828
Closed
kerneltoast wants to merge 1 commit into
Closed
kerneltoast wants to merge 1 commit into
kerneltoast wants to merge 1 commit into
Conversation
With less -FRXK as Git's pager, pressing Ctrl-C during a slow git log search can erase the results already displayed if they haven't filled the first screen yet. When Ctrl-C interrupts the initial display of slow pipe input, the signal handler marks the screen as trashed. The extra repaint added by 429ed1f ("Fix bad display if prompt_message wraps.") clears the screen, but the pending interrupt prevents it from restoring the text. With -K, less then exits and the displayed output is lost. Skip the second repaint while an abort signal is pending to let the command loop handle the interrupt first. Assisted-by: LLM
gwsw
added a commit
that referenced
this pull request
Sep 27, 2026
There are some cases where we enter forw() or back() with an abort signal pending. Previously we might clear the position table and only then notice the signal, and then return without adding any lines. It's better to return immediately without clearing the position table, so we retain the screen contents. Related to #828.
Owner
|
Fixed differently in c1a2f7c. |
Author
|
Thank you! I'll test that later today to confirm it's fixed. |
Author
|
That fix works. Closing this now as it's superfluous. Thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
less -FRXKas Git's pager, pressing Ctrl-C during a slowgit logsearch can erase results that haven't filled the first screen yet.The second repaint in
prompt()clears the screen after the signal handler marks it as trashed, but the pending interrupt prevents it from restoring the text. Skip that repaint while an abort signal is pending so the command loop can handle the interrupt first.To reproduce in a 24-row terminal, run this command and press Ctrl-C when the ten numbers appear:
Without the fix, the screen is cleared. With the fix, the displayed numbers remain visible after less exits.
This patch and PR description were written by AI.