detached a739ef9

fix(tui): repaint fully while scrolling chat

commit
a739ef9a8b83cead4c6a083259ccf761c4e6fa72
author
patriceckhart · · 2026-04-21 19:29 UTC
parent
43aca0b
signature
unsigned
refs
tag: v0.0.87
2 files · +17 -0
M internal/agent/modes/interactive.go +10 -0
@@ -530,6 +530,13 @@ func (i *Interactive) scrollBy(delta int) {
530530 i.parkedTurn = 0
531531 i.parkedTotal = 0
532532 }
533+ if i.rend != nil {
534+ // VS Code's terminal is especially prone to leaving stray
535+ // wrapped-character fragments behind during scroll-driven
536+ // viewport changes. Force a full repaint on scroll, but
537+ // avoid a whole-screen clear because that visibly flickers.
538+ i.rend.Invalidate()
539+ }
533540 i.mu.Unlock()
534541 i.invalidate()
535542 }
@@ -540,6 +547,9 @@ func (i *Interactive) scrollToBottom() {
540547 i.scrollOffset = 0
541548 i.parkedTurn = 0
542549 i.parkedTotal = 0
550+ if i.rend != nil {
551+ i.rend.Invalidate()
552+ }
543553 i.mu.Unlock()
544554 i.invalidate()
545555 }
@@ -530,6 +530,13 @@ func (i *Interactive) scrollBy(delta int) {
530 i.parkedTurn = 0530 i.parkedTurn = 0
531 i.parkedTotal = 0531 i.parkedTotal = 0
532 }532 }
533+ if i.rend != nil {
534+ // VS Code's terminal is especially prone to leaving stray
535+ // wrapped-character fragments behind during scroll-driven
536+ // viewport changes. Force a full repaint on scroll, but
537+ // avoid a whole-screen clear because that visibly flickers.
538+ i.rend.Invalidate()
539+ }
533 i.mu.Unlock()540 i.mu.Unlock()
534 i.invalidate()541 i.invalidate()
535 }542 }
@@ -540,6 +547,9 @@ func (i *Interactive) scrollToBottom() {
540 i.scrollOffset = 0547 i.scrollOffset = 0
541 i.parkedTurn = 0548 i.parkedTurn = 0
542 i.parkedTotal = 0549 i.parkedTotal = 0
550+ if i.rend != nil {
551+ i.rend.Invalidate()
552+ }
543 i.mu.Unlock()553 i.mu.Unlock()
544 i.invalidate()554 i.invalidate()
545 }555 }
M internal/tui/render.go +7 -0
@@ -62,6 +62,13 @@ func (r *Renderer) Clear() {
6262 _, _ = io.WriteString(r.out, SeqClearScreen)
6363 }
6464
65+// Invalidate forces a full repaint on the next Draw without clearing the
66+// whole terminal first. Useful when the cached diff is unreliable but a
67+// visible full-screen flash would be too distracting.
68+func (r *Renderer) Invalidate() {
69+ r.prev = nil
70+}
71+
6572 // Draw updates the terminal so that the visible frame ends with the
6673 // given lines (bottom-aligned). cursorRow/cursorCol are offsets within
6774 // the lines slice indicating where to place the terminal cursor; use
@@ -62,6 +62,13 @@ func (r *Renderer) Clear() {
62 _, _ = io.WriteString(r.out, SeqClearScreen)62 _, _ = io.WriteString(r.out, SeqClearScreen)
63 }63 }
64 64
65+// Invalidate forces a full repaint on the next Draw without clearing the
66+// whole terminal first. Useful when the cached diff is unreliable but a
67+// visible full-screen flash would be too distracting.
68+func (r *Renderer) Invalidate() {
69+ r.prev = nil
70+}
71+
65 // Draw updates the terminal so that the visible frame ends with the72 // Draw updates the terminal so that the visible frame ends with the
66 // given lines (bottom-aligned). cursorRow/cursorCol are offsets within73 // given lines (bottom-aligned). cursorRow/cursorCol are offsets within
67 // the lines slice indicating where to place the terminal cursor; use74 // the lines slice indicating where to place the terminal cursor; use

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close