C-l and C-k l repaint the whole terminal

C-l only cleared the status line and C-k l asked for nothing, and the
terminal frame then sent only what ncurses believed had changed, so
output another program wrote to the terminal stayed on screen. Both
now request a full redraw, which the terminal honors with
clearok(curscr); the GUI repaints every frame already.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:02:51 -08:00
co-authored by Claude Opus 5.5
parent 435c4d6ec6
commit 4a020df74e
5 changed files with 54 additions and 1 deletions
+23
View File
@@ -2406,3 +2406,26 @@ TEST(Audit_B7_SanitizeSpans_WholeCharacters)
ASSERT_TRUE(out[3].kind == TokenKind::Error);
ASSERT_TRUE(out[4].kind == TokenKind::Error); // the earlier-starting span wins
}
// C-l and C-k l ask the frontend for a full repaint: the terminal must
// repaint every cell, not only what ncurses believes changed, so output
// another program wrote to the terminal is cleared.
TEST(Redraw_RefreshAndReloadRequestFullRedraw)
{
TempDir d("redraw");
const std::string file = (d.path / "r.txt").string();
std::ofstream(file) << "disk\n";
TestHarness h;
Editor &ed = h.EditorRef();
std::string err;
ASSERT_TRUE(ed.OpenFile(file, err));
ASSERT_TRUE(!ed.ConsumeFullRedraw());
ASSERT_TRUE(h.Exec(CommandId::Refresh));
ASSERT_TRUE(ed.ConsumeFullRedraw());
ASSERT_TRUE(!ed.ConsumeFullRedraw()); // consumed
ASSERT_TRUE(h.Exec(CommandId::ReloadBuffer));
ASSERT_TRUE(ed.ConsumeFullRedraw());
}