You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Mouse wheel sends arrow keys to a normal-buffer CLI without mouse reporting, cycling its input history #8563
Short summary:
Scrolling the mouse wheel over a pane running an inline (non-alt-screen) CLI TUI cycles the app's prompt/input history instead of scrolling the terminal scrollback — wheel-up behaves like repeated Up-arrow presses delivered to the PTY.
What happened?
The hosted app (GJC, a CLI coding agent):
never enables mouse reporting (no CSI ?1000h / ?1006h; it even writes ?1000l/?1006l on exit),
never enters the alternate screen (no CSI ?1049h) — it renders inline on the normal buffer,
only pushes the kitty keyboard protocol (CSI > 7 u).
Per xterm.js MouseService._handlePassiveWheel, wheel-to-arrow synthesis should only fire when !buffer.hasScrollback (i.e. the alt buffer), and Orca's scrollback policy floor is 1,000 rows (default 5,000), so the normal buffer always has scrollback. Orca's own wheel multiplier (pane-terminal-mouse-wheel.ts) is also gated on the enable-mouse-events class, which never applies here. So no code path should be synthesizing arrows for this app, yet arrows arrive: the app maps Up/Down on an empty editor to prompt-history navigation, which matches the observed history cycling exactly.
Possible suspects: the TUI wheel-report changes merged in #7179 (synthetic wheel report replay/burst logic), or the patched-viewport work in #7450.
How can we reproduce it?
Run any inline (non-alt-screen) TUI that maps Up/Down to input history and does not enable mouse reporting — e.g. a CLI agent REPL.
Type a few prompts so history exists, leave the input empty.
Scroll the wheel up over the pane.
Expected: terminal scrollback scrolls. Actual: the app's input history cycles (arrow keys are delivered to the PTY).
Anything else that might help:
Shift+wheel and dragging the scrollbar still scroll the real scrollback, so the viewport itself is fine; only the plain wheel path misroutes.
changed the title [-]Mouse wheel sends arrow keys to a normal-buffer CLI without mouse reporting, cycling its input history[/-][+][Bug]: Mouse wheel sends arrow keys to a normal-buffer CLI without mouse reporting, cycling its input history[/+]on Jul 13, 2026
Host context: Windows 11 / Orca 1.4.143.0 / repo path used: docs/bug-reproductions/ Labels applied: see issue labels (has_repro or cannot_repro). Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.
Issue 8563 — Mouse wheel sends arrow keys to normal-buffer CLI without mouse reporting
Status:needs_setup (code path confirmed; interactive UI repro not run) Host: Windows 11, Orca 1.4.143, xterm @xterm/[email protected] Label:(none — interactive symptom not exercised headful)
Summary
Reporter: wheel over a pane running an inline (normal buffer) CLI that does not enable mouse reporting cycles input history (as if Up/Down were typed), instead of scrolling terminal scrollback. Shift+wheel and scrollbar still scroll correctly.
False for the alt buffer, or if scrollback max length ≤ rows.
3. Orca #7179 multiplier is not the synthesizer for this case
pane-terminal-mouse-wheel.ts — shouldMultiplyTerminalMouseWheel requires class enable-mouse-events. Unit test “leaves normal terminal scrollback alone” passes (no multiply without that class). Multiplier only replays wheel events for TUI mouse reporting; it does not emit CSI A/B itself.
So the reporter’s “no mouse reporting + normal buffer” case should use xterm passive wheel → viewport scroll unlesshasScrollback is unexpectedly false.
Repro (another agent)
Logic probe (no GUI)
cd <repo>
powershell -NoProfile -ExecutionPolicy Bypass -File docs/bug-reproductions/scripts/repro-8563-wheel-arrow-logic.ps1
# exit 3 = code path confirmed; interactive still needs headful
Interactive (needs headful Orca)
Open Orca terminal pane; run an inline REPL that maps Up/Down to history and does not emit CSI ?1000h / alt-screen (?1049h).
Enter a few prompts; leave input empty.
Wheel up over the pane.
Expected: scrollback moves. Actual (reporter): history cycles (arrows to PTY).
Compare Shift+wheel (should still scroll).
Optional instrumentation: log terminal.buffer.active.type, hasScrollback, element.classList, and PTY writes on wheel.
Expected vs actual
Expected
Normal buffer + scrollback ≥ 1000 → wheel scrolls viewport; no arrows
Actual (reporter)
Wheel delivers Up/Down to CLI history
Actual (this host)
Confirmed synthesizer + gates in source/tests; no headful confirmation
Interactive attempts 2026-07-16: evidence/8563-20260716-023109.*, evidence/8563-20260716-023344.* — orca computer scroll over window coords did not yield KEY lines (probe/terminal-create flaky under load; no headful confirmation of arrows).
Next steps / fix directions
Headful repro with logging of buffer.active.hasScrollback at wheel time (is normal buffer incorrectly reporting no scrollback?).
If hasScrollback is true but arrows still appear, search other sendData paths.
If false on normal buffer, fix scrollback option / buffer selection / xterm beta regression.
Hardening: custom wheel handler could block arrow synthesis when buffer.type === 'normal' and scrollback > 0, even if xterm disagrees.
Repro script: repro-8563-wheel-arrow-logic.ps1
# Repro #8563 (logic probe): document xterm wheel->arrow gate + Orca multiplier gate# Full interactive repro requires headful Orca + inline non-alt-screen CLI.# Usage: powershell -NoProfile -ExecutionPolicy Bypass -File docs/bug-reproductions/scripts/repro-8563-wheel-arrow-logic.ps1$ErrorActionPreference="Continue"$repo=Resolve-Path (Join-Path$PSScriptRoot"..\..\..")
Set-Location$repo$evDir=Join-Path$repo"docs\bug-reproductions\evidence"New-Item-ItemType Directory -Path $evDir-Force |Out-Null$stamp=Get-Date-Format "yyyyMMdd-HHmmss"$mouseService="node_modules\@xterm\xterm\src\browser\services\MouseService.ts"$bufferTs="node_modules\@xterm\xterm\src\common\buffer\Buffer.ts"$orcaWheel="src\renderer\src\lib\pane-manager\pane-terminal-mouse-wheel.ts"$ms=Get-Content$mouseService-Raw
$buf=Get-Content$bufferTs-Raw
$ow=Get-Content$orcaWheel-Raw
$hasPassiveArrow=$ms-match'applicationCursorKeys'-and$ms-match"deltaY < 0 \? 'A' : 'B'"$hasScrollbackGate=$ms-match'!this\._bufferService\.buffer\.hasScrollback'$hasScrollbackDef=$buf-match'return this\._hasScrollback && this\.lines\.maxLength > this\._rows'$orcaGated=$ow-match"enable-mouse-events"-and$ow-match'shouldMultiplyTerminalMouseWheel'# Run unit tests proving Orca does not multiply without mouse reporting class$log=Join-Path$evDir"8563-$stamp-wheel-tests.log"
pnpm exec vitest run --config config/vitest.config.ts `
src/renderer/src/lib/pane-manager/pane-terminal-mouse-wheel.test.ts `-t "leaves normal terminal scrollback alone"--maxWorkers=12>&1|Tee-Object$log$testsOk= ($LASTEXITCODE-eq0)
$meta=@{
issue=8563stamp=$stampxtermSynthesizesArrowsWhenNoScrollback=$hasPassiveArrowxtermGatedOnHasScrollback=$hasScrollbackGatehasScrollbackDefinition="hasScrollback && lines.maxLength > rows"hasScrollbackDefFound=$hasScrollbackDeforcaMultiplierGatedOnEnableMouseEvents=$orcaGatedunitTestNoMultiplyWithoutMouseClass=$testsOkinteractiveRepro="needs headful Orca + inline CLI without mouse reporting / alt-screen"bugReproducedInteractive=$falsecodePathConfirmed= ($hasPassiveArrow-and$hasScrollbackGate-and$orcaGated-and$testsOk)
notes="Reporter symptom (normal buffer arrows) implies hasScrollback was false unexpectedly, or another input path. Orca #7179 multiplier is correctly gated and is not the primary synthesizer."
}
$path=Join-Path$evDir"8563-$stamp-meta.json"$meta|ConvertTo-Json-Depth 5|Set-Content$path-Encoding utf8
# Also extract the critical lines for evidenceSelect-String-Path $mouseService-Pattern "hasScrollback|applicationCursorKeys|deltaY < 0"|ForEach-Object { "$($_.LineNumber):$($_.Line)" } |Set-Content (Join-Path$evDir"8563-$stamp-xterm-wheel-lines.txt") -Encoding utf8
Write-Host ($meta|ConvertTo-Json-Depth 4)
if ($meta.codePathConfirmed) { exit3 } else { exit2 }
How another agent should use this
Read this comment fully (status, expected vs actual, blockers).
If a script is included above, copy it to a temp file and run it on a Windows 11 host with Orca installed (prefer production install under %LOCALAPPDATA%\Programs\orca).
Capture evidence (CLI --json, screenshots, logs) under a local folder; optionally comment results back here.
If status is cannot_repro / needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: remove cannot_repro, add has_repro when conclusive.
Also reported from Discord as #14165 (Claude Code and Cursor agent sessions). Symptom match: mouse wheel over a long agent answer cycles input history instead of scrolling the transcript. User asked whether a focus shortcut exists; Shift+wheel / scrollbar still scroll, same as this issue.
Dug into this properly. Short version: it's alternate-screen only, and Orca already behaves like most terminals.
When an app is on the alternate screen and hasn't enabled mouse reporting, the terminal turns the wheel into Up/Down. That's deliberate — it's how less and vim scroll. If the app maps arrows to input history instead, you get this.
Verified on macOS with real wheel events, watching the bytes actually reach the pty:
pane
bytes sent to pty
result
inline agent CLI (normal buffer, mouse off)
focus reports only
scrollback scrolled fine
tmux (alt screen, mouse off)
ESC O A
shell history cycled
So a normal-buffer CLI can't produce it, which is why this was so hard to reproduce — the original report's "never enters alt screen" case doesn't happen. tmux reproduces it in one command.
The knob that controls this is DECSET 1007. Where everyone lands:
terminal
mode 1007
default
xterm
yes (alternateScroll)
off
iTerm2
yes, plus profile settings
off
GNOME Terminal / VTE
yes
on
Alacritty / Ghostty / WezTerm / Warp
yes
on
kitty
not implemented
always on
Orca (xterm.js)
not implemented
always on
Turning it off globally would cost everyone wheel scrolling in less, man and vim, so it isn't a free win.
One more thing worth knowing: Claude Code's agent view sends ?1007h — it asks for arrow keys on purpose, and warns "Scroll wheel is sending arrow keys · use PgUp/PgDn to scroll" when it detects it. That one isn't ours to fix.
So before changing anything — what do you expect the wheel to do here? Keep today's behaviour and have tmux users run set -g mouse on? A setting? Something else? And if you're hitting this outside tmux, tell us the exact app and we'll chase it.
@paulkarayan@lcorncream -- what type of behavior are you trying to mimic?
Can you point to the terminal you are using that exhibits the 'correct' behavior?
Activity
[-]Mouse wheel sends arrow keys to a normal-buffer CLI without mouse reporting, cycling its input history[/-][+][Bug]: Mouse wheel sends arrow keys to a normal-buffer CLI without mouse reporting, cycling its input history[/+]OrcaWin commentedon Jul 17, 2026
Agent reproduction package (Windows orchestration 2026-07-16)
Host context: Windows 11 / Orca 1.4.143.0 / repo path used:
docs/bug-reproductions/Labels applied: see issue labels (
has_reproorcannot_repro).Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.
Issue 8563 — Mouse wheel sends arrow keys to normal-buffer CLI without mouse reporting
Status:
needs_setup(code path confirmed; interactive UI repro not run)Host: Windows 11, Orca 1.4.143, xterm
@xterm/[email protected]Label: (none — interactive symptom not exercised headful)
Summary
Reporter: wheel over a pane running an inline (normal buffer) CLI that does not enable mouse reporting cycles input history (as if Up/Down were typed), instead of scrolling terminal scrollback. Shift+wheel and scrollbar still scroll correctly.
Code path analysis
1. xterm is the arrow synthesizer
node_modules/@xterm/xterm/src/browser/services/MouseService.ts—_handlePassiveWheel:!buffer.hasScrollback, xterm sends:i.e. Up/Down arrow sequences into the PTY (
triggerDataEvent).2.
hasScrollbackdefinitionBuffer.ts:False for the alt buffer, or if scrollback max length ≤ rows.
3. Orca #7179 multiplier is not the synthesizer for this case
pane-terminal-mouse-wheel.ts—shouldMultiplyTerminalMouseWheelrequires classenable-mouse-events. Unit test “leaves normal terminal scrollback alone” passes (no multiply without that class). Multiplier only replays wheel events for TUI mouse reporting; it does not emit CSI A/B itself.So the reporter’s “no mouse reporting + normal buffer” case should use xterm passive wheel → viewport scroll unless
hasScrollbackis unexpectedly false.Repro (another agent)
Logic probe (no GUI)
Interactive (needs headful Orca)
CSI ?1000h/ alt-screen (?1049h).Optional instrumentation: log
terminal.buffer.active.type,hasScrollback,element.classList, and PTY writes on wheel.Expected vs actual
Evidence
docs/bug-reproductions/evidence/8563-20260716-023012-meta.jsondocs/bug-reproductions/evidence/8563-20260716-023012-xterm-wheel-lines.txtdocs/bug-reproductions/evidence/8563-20260716-023012-wheel-tests.logevidence/8563-20260716-023109.*,evidence/8563-20260716-023344.*—orca computer scrollover window coords did not yield KEY lines (probe/terminal-create flaky under load; no headful confirmation of arrows).Next steps / fix directions
buffer.active.hasScrollbackat wheel time (is normal buffer incorrectly reporting no scrollback?).hasScrollbackis true but arrows still appear, search other sendData paths.buffer.type === 'normal'and scrollback > 0, even if xterm disagrees.Repro script:
repro-8563-wheel-arrow-logic.ps1How another agent should use this
%LOCALAPPDATA%\Programs\orca).--json, screenshots, logs) under a local folder; optionally comment results back here.cannot_repro/ needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: removecannot_repro, addhas_reprowhen conclusive.AmethystLiang commentedon Aug 14, 2026
Also reported from Discord as #14165 (Claude Code and Cursor agent sessions). Symptom match: mouse wheel over a long agent answer cycles input history instead of scrolling the transcript. User asked whether a focus shortcut exists; Shift+wheel / scrollbar still scroll, same as this issue.
paulkarayan commentedon Sep 2, 2026
having the same issue on a macbook pro. orca with claude.
nwparker commentedon Sep 10, 2026
Looking at this now just not reproducing it... odd
nwparker commentedon Sep 11, 2026
Dug into this properly. Short version: it's alternate-screen only, and Orca already behaves like most terminals.
When an app is on the alternate screen and hasn't enabled mouse reporting, the terminal turns the wheel into Up/Down. That's deliberate — it's how
lessandvimscroll. If the app maps arrows to input history instead, you get this.Verified on macOS with real wheel events, watching the bytes actually reach the pty:
tmux(alt screen, mouse off)ESC O ASo a normal-buffer CLI can't produce it, which is why this was so hard to reproduce — the original report's "never enters alt screen" case doesn't happen.
tmuxreproduces it in one command.The knob that controls this is DECSET 1007. Where everyone lands:
alternateScroll)Turning it off globally would cost everyone wheel scrolling in
less,manandvim, so it isn't a free win.One more thing worth knowing: Claude Code's agent view sends
?1007h— it asks for arrow keys on purpose, and warns "Scroll wheel is sending arrow keys · use PgUp/PgDn to scroll" when it detects it. That one isn't ours to fix.So before changing anything — what do you expect the wheel to do here? Keep today's behaviour and have tmux users run
set -g mouse on? A setting? Something else? And if you're hitting this outside tmux, tell us the exact app and we'll chase it.nwparker commentedon Sep 11, 2026
@paulkarayan @lcorncream -- what type of behavior are you trying to mimic?
Can you point to the terminal you are using that exhibits the 'correct' behavior?