research-tui-scroll

Research: TUI scroll-mode toggle — pick a key that doesn't clash with codex/claude/shell

Metadata

Statusdone
Assignedagent-1156
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelclaude:opus
Created2026-04-29T17:25:12.121349189+00:00
Started2026-04-29T17:30:10.796679947+00:00
Completed2026-04-29T17:37:57.863520084+00:00
Tagspriority-high,research,tui,ux,input, eval-scheduled
Eval score0.88
└ blocking impact0.95
└ completeness0.90
└ constraint fidelity0.55
└ coordination overhead0.95
└ correctness0.95
└ downstream usability0.85
└ efficiency0.85
└ intent fidelity0.90
└ style adherence0.90

Description

Description

User report: in the wg TUI, keys like PgUp / PgDn / arrows are passed through to the inner PTY app (codex, claude, nex, or whatever shell-like thing is in there), so the user can't use them to navigate the OUTER scrollback. Touch scroll works (recently confirmed); mouse wheel queued (fix-mouse-wheel). But there's no keyboard-driven path to scroll, which is the right path for a serious TUI.

User quote: 'we need something like control T but some other control that's not getting in the way of typical applications. to be able to go into a mode where we can do page up and page down and arrow up and down to read things... we need a kind of research task that establishes [this]. Then that should feed naturally into a process that's going to effectively resolve the problem.'

Goal

Pick the toggle key + mode semantics for scroll mode. Hand off concrete spec to the implementation task.

What to investigate

1. Survey conventions in existing TUI tools

  • tmux: Ctrl+B [ → copy mode (PgUp/Down, arrows, vim-style nav, search). Exit with q or Esc.
  • screen: Ctrl+A [ (or Esc) → copy mode, similar.
  • less / more: not modal — already a pager; arrows + PgUp/Down work directly.
  • vim: command vs insert mode — Esc enters command mode.
  • htop / btop: arrows scroll the process list directly; no special mode needed because the inner content is the only thing.

The wg TUI is more like tmux: there's an inner app (codex/claude) AND an outer chrome (chat tabs, viz, status). The conflict is identical to tmux's, so the tmux solution is the obvious shape.

2. Pick the toggle key

Constraints:

  • Must NOT clash with what codex CLI uses (codex --help → check its keymap; Ctrl+T is reserved per the screenshot earlier)
  • Must NOT clash with what claude CLI uses (similar check)
  • Must NOT clash with common shell shortcuts (Ctrl+C signal, Ctrl+D EOF, Ctrl+Z suspend, Ctrl+L clear, Ctrl+R reverse-history-search)
  • Must be ergonomic on US keyboards (no awkward stretches)
  • Should ideally NOT clash with tmux's Ctrl+B if the user is running wg TUI inside tmux — but the user can rebind tmux's prefix, so this is softer

Candidates worth evaluating with research:

  • Ctrl+G — sometimes used as 'cancel' in some TUIs, otherwise rare
  • Ctrl+\ — quit signal in shell (SIGQUIT) — bad
  • Ctrl+] — telnet escape, otherwise uncommon
  • Ctrl+_ — undo in some apps; otherwise rare
  • F2/F3 — function keys usually not captured; widely available
  • Alt+/ or Alt+S — Meta combos uncommon in CLI apps but require Alt-mapping support
  • Ctrl+Space — sometimes used for completion; otherwise rare

Cross-check each candidate against codex / claude actual keymaps. Pick one that's free in both.

3. Mode semantics

Modal (recommended): toggle enters scroll mode, status bar shows 'SCROLL MODE — q/Esc to exit'. In scroll mode:

  • PgUp / PgDn scroll the active pane's scrollback
  • Arrow keys scroll line-by-line
  • Home / End jump to top / bottom
  • Optional: / to search forward, ? backward (vim-style); n / N next / prev match
  • Optional: v enters visual selection; y yanks (matches tmux copy mode)
  • Esc / q exits back to passthrough

Non-modal (rejected for first version): use a chord like Ctrl+G PgUp = single page up, key passes back to inner app immediately. Ergonomically worse for reading more than a single page.

4. Visual indicator

Status bar should always show the toggle key reminder when in passthrough mode ('Ctrl+? to scroll'), AND switch to a mode indicator when in scroll mode ('SCROLL MODE — q/Esc to exit'). First-run hint optional.

5. Per-pane vs global

Active pane only. Switching panes while in scroll mode either exits scroll mode OR moves the scroll context to the new pane (pick one; recommend exit-on-pane-switch for simplicity).

Deliverable

Design doc posted via wg log with:

  • Chosen toggle key + rationale (why not the others)
  • Cross-check table: codex / claude / nex / common shells — confirmation that the chosen key is free in each
  • Mode semantics specified (key list with action per key)
  • Visual indicator design (status bar text in each state)
  • File pointers in src/tui/ where the input dispatch needs to grow the scroll-mode arm
  • Smoke scenario list

Validation

  • Toggle key chosen with rationale
  • Cross-check: chosen key verified to NOT be captured by codex / claude / common shells (cite each tool's docs or keymap)
  • Mode semantics fully specified (every key the mode handles)
  • File pointers for the implementation
  • Smoke scenario list (enter mode, scroll, exit, verify state restoration)
  • No source modifications — research only

Depends on

Required by

Log