Skip to content

fix(terminal): speed up an application's wheel only with Alt, as before xterm.js 6 (#2336) - #2357

Merged
devswha merged 1 commit into
mainfrom
fix/xterm6-visual-audit
Oct 29, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/xterm6-visual-audit

Conversation

@devswha

@devswha devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Change

Closes #2336. Since xterm.js 6.0.0 (#2335), a trackpad wheel held with Ctrl scrolls a mouse-reporting application faster than before. xterm 6 dropped the fastScrollModifier option (5.5's default was Alt), and CoreMouseService._applyScrollModifier now multiplies the wheel by fastScrollSensitivity (5) whenever Alt, Ctrl or Shift is held.

xterm sends at most one report per wheel event, once the travel it has added up reaches a row. So the multiplier matters only for steps under a row: a trackpad's small steps reported up to five times as often, while a mouse wheel's full notch sent one report either way. Shift was already unaffected, because 6.0's consumeWheelEvent returns 0 for it.

The fix is the same Ovis xterm patch (patches/@xterm%[email protected]), with one more condition in the CoreMouseService hunk that is already there: only Alt speeds the wheel up, as in 5.5. Nothing else relied on Ctrl speeding it up:

  • Viewport.ts already speeds up on Alt only, and it scrolls xterm's own history, which stays at scrollback: 0.
  • terminalWheel.ts already leaves a Ctrl wheel (a trackpad pinch) out of the speed repeat.

Test (fails first)

scripts/omo-question-wheel-regression.ts sends 12 Ctrl-held steps of 0.55 rows to a real mouse-capturing program in a herdr pane. The steps travel 6.6 rows, plus under one row left over from earlier steps. It then sends a wheel down (button 65) to mark the end, and counts the Ctrl wheel-up reports (SGR button 80).

Ctrl-held reports
main (8a3bc90e) 12: AssertionError: 12 Ctrl-held steps of 0.55 rows report one wheel per row, 6 or 7, not 12
this branch within 6–7: PASS Ctrl-held wheels report at the normal speed

xterm 6 audit (lane xterm6-audit)

Before this fix, I compared xterm 6 against the release before it:

  • Builds: v0.4.19, the commit just before feat(terminal): upgrade xterm.js to 6.0.0 for synchronized output (#1617) #2335 (ae3f080e, which separates xterm 6 from the rest of 0.4.20) and main.
  • Setup: each on its own loopback server with a fresh state dir, against an isolated herdr test session.
  • Fixture: one pane with 16, 256 and true colours, bold, dim, italic, underline and strikethrough, Hangul with backgrounds, powerline and box-drawing glyphs, and a URL.
  • Coverage: all 25 theme entries (24 on v0.4.19) at 1280 and at phone 390. Pixel diffs plus DOM metrics: cell size, rows, padding, the backgrounds of every layer, the scrollbar.
Area xterm 6 against the build before it Verdict
Frame around the terminal An 8px #000 frame in every theme. It is plain in 21 entries and near-invisible on the near-black dark ones. Regression, fixed by #2355 (not touched here)
Glyphs, colours, powerline, box drawing, Hangul rows and backgrounds Pixel-identical in every theme at both widths None
Font metrics, 17px line height (0.4.20's Hangul line-gap fix), padding Identical None
Phone key bar Identical None
Selection colour, cursor (focused and unfocused), link underline and pointer on hover Identical None
Drag-select copy to the clipboard, bracketed paste bytes, the view after a resize and back Identical None
xterm 6's new scrollbar Stays invisible (opacity: 0, pointer-events: none) and lets clicks through at the right edge None
Ctrl+wheel in an application Up to 5x faster for small steps Regression, fixed here

Every difference against v0.4.19 outside those two rows comes from 0.4.20's own font and line-height work, not from xterm 6, and is intended.

Checks

  • bun run check fast: green on this head.
  • Reviews:
    • omo-native-code-reviewer: APPROVE, with one LOW (the wording "twice as fast" fit only the test's step size), fixed.
    • Codex Sol 6.1 (fast, xhigh): APPROVE, no findings. It also swept 10,000 leftover-row values and found the 6–7 range holds for all of them.
  • This changes patches/, so the hold on merging patches/ changes applies while a release that raises REMOTE_BUNDLE_VERSION is in progress.
  • Merge after fix(terminal): match the viewport background to the active theme #2355.

…re xterm.js 6 (#2336)

xterm.js 6 dropped fastScrollModifier and multiplies the wheel by fastScrollSensitivity under Alt, Ctrl or Shift. Shift already sends no report, but a Ctrl-held trackpad wheel reported up to five times as often in a mouse-reporting application. The patch accelerates only on Alt, as 5.5's default did, and the wheel regression sends 12 Ctrl-held 0.55-row steps and expects 6 or 7 reports (12 before).
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8a3bc90 and 191944c.

Files selected for processing: 3
  • changelog.d/ctrl-wheel-speed.md
  • patches/@xterm%[email protected]
  • scripts/omo-question-wheel-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Ctrl+trackpad scrolling in terminal applications now stays at normal speed; Alt remains the modifier for faster scrolling.
    • Alt+Left/Right once again moves by word in terminal applications.
    • Improved handling of text composition, including Hangul input and dictation, so pending text is committed more reliably.
  • New Features

    • Applications embedding the terminal can constrain the on-screen input area and inspect the state of an in-progress OSC string.

The xterm.js 6 mouse patch now applies fast-scroll sensitivity only when Alt is held. Ctrl-held pixel-wheel input uses normal reporting, and a regression check verifies the expected report count.

Changes: Wheel Speed Correction

Layer / File(s) Summary
Modifier behavior and regression check
patches/@xterm%[email protected], scripts/omo-question-wheel-regression.ts, changelog.d/ctrl-wheel-speed.md
Fast-scroll sensitivity now applies only for Alt, not Ctrl or Shift. The regression script checks that 12 Ctrl-held upward wheel events produce 6 or 7 reports. The changelog records the normal-speed behavior.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Minimal · up to 19194

The requested Ctrl-wheel behavior is implemented and covered by the focused regression check, with no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: Ctrl-held wheel input in mouse-reporting applications should no longer speed up, so only Alt accelerates it, as in xterm.js 5.5. The title matches the objectives and t…
Description check Passed The description follows the template. It has a Change section that describes the problem (Ctrl+wheel speed-up since xterm.js 6.0.0), the cause, and the fix. It has a Validation section that lists the …
Linked Issues check Passed Issue [#2336] requires fast-scroll acceleration only for Alt and a Ctrl-wheel regression test. The patch changes CoreMouseService._applyScrollModifier from Alt/Ctrl/Shift to Alt only. `scripts/omo-q…
Out of Scope Changes check Passed The whole-PR diff contains the targeted CoreMouseService condition and its explanatory comment, the linked regression coverage, and a related changelog entry. These changes support issue [#2336]. No…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the main change: Ctrl-held wheel input in mouse-reporting applications should no longer speed up, so only Alt accelerates it, as in xterm.js 5.5. The title matches the objectives and the patch change. It uses the "fix(terminal)" prefix and includes the issue number.

Full details: Description check

Explanation

The description follows the template. It has a Change section that describes the problem (Ctrl+wheel speed-up since xterm.js 6.0.0), the cause, and the fix. It has a Validation section that lists the regression test, the results on main and on this branch, the xterm 6 audit, and the checks run. It links issue #2336 as the agreed scope.

Full details: Linked Issues check

Explanation

Issue [#2336] requires fast-scroll acceleration only for Alt and a Ctrl-wheel regression test. The patch changes CoreMouseService._applyScrollModifier from Alt/Ctrl/Shift to Alt only. scripts/omo-question-wheel-regression.ts sends 12 Ctrl-held 0.55-row steps and asserts 6–7 SGR wheel reports, matching the normal-speed behavior. The changelog records the fix.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains the targeted CoreMouseService condition and its explanatory comment, the linked regression coverage, and a related changelog entry. These changes support issue [#2336]. No unrelated PR-introduced code change appears in the reviewed diff.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Merging 191944c (closes #2336; a 0.4.20 regression from xterm.js 6). The xterm patch again speeds up the wheel only while Alt is held, as xterm.js 5.5's default fastScrollModifier did; 6.0 also sped it up for Ctrl (Shift is already excluded earlier in consumeWheelEvent), so Ctrl+wheel in a mouse-reporting application sent twice the reports. The merge pass read the patch hunk (one condition, ev.altKey only). A fail-first browser assertion in scripts/omo-question-wheel-regression.ts counts 12 Ctrl-held reports on main and 6-7 after. The lane's xterm 6 audit found no other visual differences from the pre-xterm-6 build besides the gutter frame fixed in #2355. Lane evidence: check fast green; omo and Codex APPROVE.

@devswha
devswha merged commit e604183 into main Oct 29, 2026
12 checks passed
@devswha
devswha deleted the fix/xterm6-visual-audit branch October 29, 2026 12:30
devswha added a commit that referenced this pull request Oct 29, 2026
…n again, tap to dictate (#2371)

## Change

Docs only: `docs/guide.md` now matches what 0.4.20 and current main do.
I checked each claim against the code that decides it (file:line in the
table below) and changed only `docs/guide.md`.

- **Letta Code.** The Supported agents cell is short now: it says what
Letta needs (`herdr integration install letta`) and that a turn shows
once it ends, with **Working…** in the meantime. The binding rules moved
to a new **Letta Code** subsection at the end of the section, which also
says what a running turn looks like and lists the three known
wrong-conversation cases of #2314.
- **Subscription usage.** Expired Claude and Codex accounts get **Sign
in again**. Hub accounts do not.
- **Chat.** The faded bubble a sent message shows until its turn is
written: the clock after 5 s, the bubble gone after a minute, no bubble
for `/…` and `!…` commands. Also the Claude Code bash-mode (`!`) card,
with stderr in red.
- **Terminal.** xterm.js 6 draws only whole frames, and Alt speeds the
wheel in a program that reads the mouse.
- **Voice input.** On a touch screen with the browser's own recognition,
you tap to start and tap to finish. An iPhone home-screen app asks for
the mic on the first tap, not when Voice input is turned on. When Siri &
Dictation is off, the mic says so. A mouse, or an API key, still allows
hold-to-talk.
- **Quick start.** On a slow link, the boot spinner shows while the app
downloads.
- **Manage sessions.** The Ultracode switch in New workspace and New
tab, linked to agent-commands.md.

The OpenCode drag text (#2368) was already accurate, so it is unchanged.
The agent install flow (`changelog.d/agent-install-run.md`) is left out:
`AgentSetupCard` is not mounted anywhere yet, so users have no surface
for it.

| Claim | Code |
| --- | --- |
| Letta writes a turn only at its end; cancelled turns are never written
| `server/letta.ts:1-12` |
| Letta binding: herdr report + project record + start folder |
`server/letta-store.ts:1-19`, `lettaRecordOwned` `:247-258` |
| Working… while a turn runs, no live terminal box |
`src/components/ChatView.tsx:2265-2277`; #2338 |
| Sign in again: expired, Claude/Codex, not hub | `src/lib/usage.ts:83`;
`UsageMeters.tsx:55-66`; `UsageSettings.tsx:40` |
| Faded bubble 5 s clock / 60 s / no bubble for commands |
`src/lib/sentWaiting.ts` (`WAITING_HINT_MS`, `WAITING_SEND_MS`,
`becomesTurn`) |
| xterm.js 6; Alt-only fast wheel | `package.json` `@xterm/xterm` 6.0.0;
patch per #2357 |
| Touch + browser engine = tap; hold otherwise |
`src/components/VoiceInput.tsx:258-300` |
| Siri & Dictation off is named | `src/lib/voice.ts:302-303`;
`VoiceInput.tsx:22` |
| Boot spinner | `index.html:40` |
| `!` card, stderr in red | `server/claude-transcript.ts:94-95`;
`ChatView.tsx:1079-1088` |
| Ultracode switch, Claude Code 2.1.284+ |
`src/components/NewSessionDialog.tsx:398-402` |

No changelog fragment: each behaviour described here already has its own
changelog entry, in 0.4.20 or in `changelog.d/`, and this PR only brings
the guide up to date with them.

## Verification

- `bun run check fast`: green on b16eabc (typecheck, build, generated
files, 8666 unit tests pass, 0 fail). Also green on 0d8db7e and
d2527fe.
- No test: this is a prose-only change (repo rule: doc text is never
pinned by a test).

## Reviews

- **omo-native-code-reviewer** on 0d8db7e: APPROVE, no
CRITICAL/HIGH/MEDIUM. Its 5 LOW points were checked against the code and
applied in d2527fe: Alt speeds a trackpad wheel; Ultracode's
prerequisites; the faded bubble only in a native-session chat; the first
#2314 case needs Ovis not to have looked first; the iPhone home-screen
mic rule is its own bullet.
- **Codex Sol 6.1 fast xhigh**, round 1 on 0d8db7e: REQUEST CHANGES
with 5 MEDIUM. All five were checked against the code and fixed in
d2527fe:
- Letta: a second pane, or a turn not yet written, clears by itself,
without restarting `letta` (`letta-store.ts:195,288`).
- The bubble's clock means the turn is not written yet, not that the
agent has not taken it (`sentWaiting.ts`).
  - xterm.js 6 waits for a synchronized frame for up to a second.
- The Ultracode switch only asks Claude Code, which ignores it without
xhigh and dynamic workflows (`agentLaunchMode.ts`).
- Silence is trimmed only where the recorder can pause; otherwise the
whole recording is sent (`voice.ts:613-620`). This was a stale sentence
next to the touched text.
LOWs applied: start `letta` once before `herdr integration install
letta` (`agent-catalog.ts:875`); the 2 s record margin; 401/403 also
read as expired (`usage.ts:1052`); the voice level shows only when the
server transcribes (`voice.ts:491`).
- **Codex round 2** on d2527fe only: one MEDIUM. A Letta pane in the
home folder never binds (`letta-store.ts:255`), so "until letta starts
again" was wrong there. Fixed in b16eabc with Codex's own wording.
Under the review cap, there is no further round.
- Left as written (LOW): Codex noted that "rare" for the #2314 cases is
a judgment, not something the code shows. Each case needs a Letta folder
move plus a conversation switch Ovis did not see, which is why the guide
calls them rare.

Docs only, so no CodeRabbit review is requested (AGENTS.md: a docs
commit gets none).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl+wheel scrolls an application twice as fast since xterm.js 6

1 participant