detached 728cf4e

tui: allow chat scroll (up/down/pgup/pgdn) while the agent is busy

the up/down handlers required !i.busy before routing to scrollBy,
which meant you couldn't scroll back through a long streaming reply
while it was still arriving. dropped the busy check \u2014 chat scroll
now works in both states, consistent with pgup/pgdn which never
had the restriction.
commit
728cf4e2b16217feb0c5a7ed5e9d1b4d8618a863
author
patriceckhart · · 2026-04-18 09:33 UTC
parent
c0f685f
signature
unsigned
refs
tag: v0.0.4
1 file · +6 -4
M internal/agent/modes/interactive.go +6 -4
@@ -580,14 +580,16 @@ func (i *Interactive) handleKey(ctx context.Context, k tui.Key) (done bool) {
580580 i.scrollBy(-i.chatPage())
581581 return false
582582 case tui.KeyUp:
583- // Wheel-up in alt screen sends Up arrows on most terminals. When the
584- // editor is empty and we're not busy, use that for chat scroll-up.
585- if i.ed.IsEmpty() && !i.busy {
583+ // Wheel-up in alt screen sends Up arrows on most terminals.
584+ // When the editor is empty we use up/down for chat scroll —
585+ // independently of whether the agent is busy, so users can
586+ // scroll back through long streaming replies while they run.
587+ if i.ed.IsEmpty() {
586588 i.scrollBy(+3)
587589 return false
588590 }
589591 case tui.KeyDown:
590- if i.ed.IsEmpty() && !i.busy {
592+ if i.ed.IsEmpty() {
591593 if i.scrollOffset > 0 {
592594 i.scrollBy(-3)
593595 }
@@ -580,14 +580,16 @@ func (i *Interactive) handleKey(ctx context.Context, k tui.Key) (done bool) {
580 i.scrollBy(-i.chatPage())580 i.scrollBy(-i.chatPage())
581 return false581 return false
582 case tui.KeyUp:582 case tui.KeyUp:
583- // Wheel-up in alt screen sends Up arrows on most terminals. When the583+ // Wheel-up in alt screen sends Up arrows on most terminals.
584- // editor is empty and we're not busy, use that for chat scroll-up.584+ // When the editor is empty we use up/down for chat scroll —
585- if i.ed.IsEmpty() && !i.busy {585+ // independently of whether the agent is busy, so users can
586+ // scroll back through long streaming replies while they run.
587+ if i.ed.IsEmpty() {
586 i.scrollBy(+3)588 i.scrollBy(+3)
587 return false589 return false
588 }590 }
589 case tui.KeyDown:591 case tui.KeyDown:
590- if i.ed.IsEmpty() && !i.busy {592+ if i.ed.IsEmpty() {
591 if i.scrollOffset > 0 {593 if i.scrollOffset > 0 {
592 i.scrollBy(-3)594 i.scrollBy(-3)
593 }595 }

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