Skip to content

feat(terminal): upgrade xterm.js to 6.0.0 for synchronized output (#1617) - #2335

Merged
devswha merged 4 commits into
mainfrom
feat/xterm-6
Oct 29, 2026
Merged

devswha merged 4 commits into
mainfrom
feat/xterm-6

Conversation

@devswha

@devswha devswha commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Change

Closes #1617. Targets 0.4.20 (the owner moved it in from 0.4.21). This upgrades xterm.js from 5.5.0 to 6.0.0, so a terminal draws only whole frames: xterm 6 honours synchronized output (DEC mode 2026, xtermjs/xterm.js#5453). Ovis's xterm source patch is ported to 6.0.0. It follows #2331 (merged), whose regression script measured the problem; this PR makes that script assert zero half-drawn frames.

Why: herdr sends every frame it draws inside CSI ? 2026 h … l, and large frames reach the browser split over several WebSocket frames. xterm 5.5 ignored the brackets and painted whatever it had parsed so far: the top half of the new frame over the bottom half of the old one. The owner saw this while agents stream, most of all with Korean text.

scripts/terminal-sync-output-regression.ts, real pane, 162x53 renders mixed (two frames at once) drawn inside an open block
xterm 5.5.0 (main), 3 runs 128 / 108 / 110 46 / 26 / 28 46 / 26 / 28
xterm 6.0.0 (this PR), 3 runs 82 / 82 / 82 0 / 0 / 0 0 / 0 / 0

In every run, all 62 of herdr's blocks reached the browser intact, and 59-62 of them were split over WebSocket frames. 6.0 also renders fewer times (82 against 108-128), because it skips the intermediate paints.

What changed

  • Pins:
    • @xterm/xterm 6.0.0, @xterm/addon-fit 0.11.0 (was ^0.10.0) and @xterm/addon-web-links 0.12.0 (was 0.11.0). All three were released with 6.0.0 on 2025-12-22.
    • @xterm/addon-unicode-graphemes 0.4.0 is unchanged; it was already the 6.0 release.
  • The patch (patches/@xterm%[email protected], which replaces the 5.5.0 one):
  • Building xterm's source: scripts/build-xterm.ts and the Vite aliases resolve 6.0's vs/* sources and its vs/nls stub, and use xterm's own useUnknownInCatchVariables: false for them. The browser scripts that bundle xterm with Bun.build (terminal-dispose-browser-qa.ts, chat-history-browser-qa.ts) now share one plugin, xtermSourcePlugin, with the same resolution. terminal-dispose-browser-qa.ts had resolved only browser/ and common/, through a second plugins key; the lane caught it.
  • Tests:
    • scripts/terminal-dispose-browser-qa.ts: 5.5 threw "dimensions" from a terminal disposed at once, and 6.0 does not, so both modes now assert no error.
    • scripts/xterm-parser-state.test.ts pins 6.0.0. The parser fields and states the OSC accessor reads are unchanged, and that test checks them.
    • scripts/terminal-sync-output-regression.ts now asserts 0 mixed renders and 0 renders drawn inside an open block.
  • Docs and comments: updated where the version mattered. THIRD_PARTY_NOTICES.md adds Microsoft's copyright for the vs/base code 6.0 bundles (MIT).

6.0 changes checked against Ovis

  • #5263 (the helper textarea is read-only while disableStdin): Ovis sets disableStdin only where input is dropped anyway (observing, held, ended, unsupported). Drafts come from onData, which never fires then. A phone keyboard no longer opens on such a pane, which matches "an observer never types".
  • fix(composer): a tap on the context ring shows its number on a phone #5096 (new viewport and scrollbar): we keep scrollback: 0, and fit 0.11 reserves no scrollbar width at scrollback: 0. Our ::-webkit-scrollbar rule is now inert.
  • #5462 (removed options): Ovis uses none of them. _oscLinkService (the OSC 8 lookup in terminalFold.ts) still exists.
  • Mode 2026 left open: every new stream resets xterm first, so mode 2026 never carries over. A pane switch calls term.reset(), and an attach or watch writes ESC c in stream order. The cached-tab path is bounded by xterm's 1 s safety timeout. A late joiner gets the last 2026 switch from ReplayBuffer.
  • ED2 (\x1b[2J) inside DEC 2026 synchronized update block resets viewportY, causing scroll yank during streaming redraws xtermjs/xterm.js#5801 (ED2 inside a 2026 block moves the viewport): this cannot happen here. I checked it with a real Claude Code 2.1.311 answer in Korean, plus a resize, on this branch. Across 238 blocks only one ESC [2J reached the browser, herdr's own first draw, because herdr re-renders the pane rather than passing Claude Code's erases on. xterm's viewport never had anything to scroll: its scroll range and scroll position stayed 0 on every render, since we keep scrollback: 0. The settled screen matched herdr's pane.read row for row, 14 Hangul rows included.
  • modifyOtherKeys: still not supported by 6.0, so PaneTerminal keeps sending Ctrl+Enter itself, as before.

Evidence

  • bun run check fast: green on this head (8,566 unit tests pass, 0 fail).

  • The browser lane (IME, paste, OSC 52 replay, late join and every terminal script): CI's browser regression jobs run it on this head. A full local run is under way, and its result will follow in a comment.

    • Earlier local runs caught two problems, both fixed here: terminal-dispose-browser-qa.ts could not resolve 6.0's vs/ sources, and ui-contexts failed on the usage-row race.
    • On this head, terminal-dispose-browser-qa.ts, chat-history-browser-qa.ts, terminal-arrows-clicks-regression.ts, omo-question-wheel-regression.ts, ui-regression.ts and ui-contexts-regression.ts pass locally.
  • Changelog: changelog.d/xterm-6-whole-frames.md.

  • Device checks with native input, main (4485f4d6, xterm 5.5) against this branch (e3c33e32). The later commits change only the wheel factor, tests and comments.

    Surface Typed main this branch
    Mac Safari 27.0.1, Korean 2-set, native HID keys (test Mac) abc 한글 Space 안녕하세요 Return, then 한 Backspace Return exact, 30 bytes exact, 30 bytes
    Mac Safari, Option+Left / Option+Right ESC b ESC f ESC b ESC f
    iOS 27 simulator Safari, on-screen Korean keyboard (WebDriverAgent taps) ㅇㅏㄴㄴㅕㅇ Space, 한 Backspace, Return, slow and unpaced exact, 22 bytes exact, 22 bytes
    Ovis iOS app (Debug build, WKWebView without a Safari token, fix(terminal): compose Hangul in the iOS app, whose web view does not say Safari (#2302) #2307) same exact, 22 bytes exact, 22 bytes
    Windows 11 VM, Chromium 153, Microsoft Korean IME through SendInput 한 Backspace Return 하\r 하\r
    same abc 한글 Space 안녕하세요 Return identical bytes on both, with one extra DEL after Return on both (the test driver timed out at the same Return, so it may be the driver; not from this change) same

    Faster native typing than about one key per 0.75 s could not be driven reliably on the simulator.

  • Windows CI steps in the VM (windows-install.test.ps1, preflight, frozen install, build, the Windows test set, windows-terminal-browser-qa.ts): 7 of 7 pass on both main and this branch (45 tests pass, 1 skipped).

Reviews

  • omo-native-code-reviewer: APPROVE; no CRITICAL or HIGH.
    • M1, fixed: 6.0's trackpad scaling. The patch now keeps one report per row, and omo-question-wheel-regression.ts gained a case that sends 12 untrusted pixel wheels of 0.55 rows and expects 6 reports; with 6.0's scaling it gets 2.
    • Fixed LOWs: an Alt+ArrowLeft assertion in terminal-arrows-clicks-regression.ts, so the kept mapping cannot silently drop again; and three comments.
    • Not changed:
      • L1: the read-only textarea is checked by reasoning; the device runs above typed only on panes that take input.
      • L2: a stream that stops inside a block now shows its half frame after xterm's 1 s timeout instead of at once. Every pane switch, attach and watch resets the terminal first, so this applies only to a cached tab's re-attach.
  • Codex (gpt-6.1-sol, fast, xhigh): APPROVE on the upgrade, with no findings at any severity. It compared every hunk; typecheck passed, and 2,571 targeted tests pass.
  • Codex on the follow-ups (the wheel hunk, the shared plugin, the test changes): REQUEST CHANGES, both fixed, then APPROVE with no findings.
    • MEDIUM: the Alt+ArrowLeft expectation now follows the page's platform (ESC b on a Mac), as xterm decides.
    • LOW: the dispose test again proves the deferral defers. With both modes now expecting no errors, the deferred case asserts the terminal is still alive after xterm's queued frames, and disposed only after the following task.
    • Codex checked that removing the Alt mapping, or disposing immediately, after the frame only, or not at all, makes those tests fail.
  • CodeRabbit on test(terminal): follow synchronized output from a real pane to the rendered rows (#1617) #2331: one nitpick. The harness should compare acked flow identities, not only counts. Done here.

Also in this PR

  • test(usage): …: checkUsageSignInAgain (from feat(usage): sign in again to an expired Claude or Codex account #2309) counted Settings' account rows right after opening the page, before /api/usage had drawn them. It failed in 2 of 3 browser-lane runs on this branch and passed once on main. It now waits for the rows.
  • The browser lane's ui-regression.ts fails when TMPDIR is under $HOME, because the folder picker shows the path as ~/…. This is a test assumption, not touched here; the lane was run with TMPDIR under /tmp.

…rawn them

checkUsageSignInAgain counted .usage-accounts-row right after opening the Subscription usage page, but the rows come with /api/usage, which the page loads once it is shown: the count read 0 whenever the report had not arrived yet. It now waits for the fourth row first, in both places.
@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 99147f8 and 5626ad4.

Files ignored due to path filters: 1
  • bun.lock is excluded by !**/*.lock, !bun.lock
Files selected for processing: 18
  • THIRD_PARTY_NOTICES.md
  • changelog.d/xterm-6-whole-frames.md
  • docs/terminal-input.md
  • package.json
  • patches/@xterm%[email protected]
  • scripts/build-xterm.ts
  • scripts/chat-history-browser-qa.ts
  • scripts/omo-question-wheel-regression.ts
  • scripts/terminal-arrows-clicks-regression.ts
  • scripts/terminal-dispose-browser-qa.ts
  • scripts/terminal-sync-output-regression.ts
  • scripts/usage-regression.ts
  • scripts/xterm-parser-state.test.ts
  • src/lib/inputRow.ts
  • src/lib/keys.ts
  • src/lib/terminalDispose.ts
  • src/lib/terminalFold.ts
  • vite.config.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

  • New Features
    • Updated the browser terminal to xterm.js 6, which displays complete frames to avoid mixing older and newer screen content during streamed updates.
  • Bug Fixes
    • Improved text entry for Korean input, dictation, and Safari composition edits, including when input is interrupted by actions such as paste or blur.
    • Restored Alt+Left/Right word navigation and improved trackpad scrolling for small movements.
  • Documentation
    • Updated terminal input and rendering notes for xterm.js 6.

The project upgrades xterm.js and its add-ons to version 6. It ports terminal input and parser changes, updates source-build resolution, and revises regression checks for rendering, input, and disposal behavior.

Changes: xterm.js 6 upgrade

Layer / File(s) Summary
Dependency and source-build wiring
package.json, scripts/build-xterm.ts, scripts/chat-history-browser-qa.ts, vite.config.ts, THIRD_PARTY_NOTICES.md, changelog.d/*, docs/terminal-input.md, src/lib/*
The project updates xterm dependencies and source resolution for xterm 6. Notices, changelog text, input documentation, and compatibility comments are revised.
Composition and terminal input
patches/@xterm%[email protected]
The patch updates composition tracking, Hangul and Linux digit input handling, replacement-text commits, and textarea positioning. It adds public methods and typings for finishing composition and setting viewport bounds.
Parser state and terminal key behavior
patches/@xterm%[email protected]
The patch exposes OSC parser state, changes Alt+arrow sequences, and removes scaling for small pixel-wheel deltas.
Terminal regression checks
scripts/omo-question-wheel-regression.ts, scripts/terminal-arrows-clicks-regression.ts, scripts/terminal-dispose-browser-qa.ts, scripts/terminal-sync-output-regression.ts, scripts/xterm-parser-state.test.ts
Regression checks cover wheel input, Alt+arrow input, disposal timing, synchronized-output frame integrity, and parser state.

Usage regression test wait

Layer / File(s) Summary
Wait for account rows
scripts/usage-regression.ts
The local-device and watching-device checks wait for the fourth Settings account row before asserting the row count.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • Issue 1488 concerns lost iOS dictation text. This change ports composition and dictation-related input handling, but does not establish whether that issue is resolved.
  • Issue 2225 concerns terminal arrow and click determinism. This change adds an Alt+ArrowLeft check, but does not add attach-delivery acknowledgement coverage.

Possibly related PRs

  • devswha/ovis#2031: Updates composition positioning so long compositions keep their newest characters visible; this change ports that behavior to xterm 6.
  • devswha/ovis#1654: Defers Linux digit key handling for IME candidate input; this change ports that behavior to xterm 6.
  • devswha/ovis#1850: Adds Safari dictation, Hangul replacement, and deferred composition-send handling; this change ports those behaviors to xterm 6.
Merge Risk: Minimal · up to 5626a

No merge-blocking regression was established; native fcitx5 input remains unverified.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Out of Scope Changes check Warning The change in scripts/usage-regression.ts only changes the Settings usage-account-row wait in checkUsageSignInAgain. It has no connection to xterm 6, synchronized output, terminal input, or the te… Remove the unrelated scripts/usage-regression.ts change from this pull request, or move it to a separate pull request.
Linked Issues check Inconclusive For [#1617], the PR evidence supports the core upgrade. It reports intact DEC mode 2026 blocks, mixed renders on xterm 5.5, zero mixed or open-block renders on xterm 6, compatible addon pins, the xter… Provide a completed browser-lane result and test evidence for the required split, multi-bracket, malformed-parameter, late-join, replay-truncation, observer-join, disconnect, and missing-close scenarios. The available evidence is insufficie…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: upgrading xterm.js to 6.0.0 to support synchronized output.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Description check Passed The description is complete and follows the required template. It explains the problem, resulting behavior, implementation changes, validation results, regression coverage, and known test caveats. The…
Full details: Docstring Coverage

Explanation

Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. 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 6 functions across 13 files. (5 skipped: 5 unsupported.)

Full details: Description check

Explanation

The description is complete and follows the required template. It explains the problem, resulting behavior, implementation changes, validation results, regression coverage, and known test caveats. The validation section also identifies checks that passed and the browser lane status.

Full details: Out of Scope Changes check

Explanation

The change in scripts/usage-regression.ts only changes the Settings usage-account-row wait in checkUsageSignInAgain. It has no connection to xterm 6, synchronized output, terminal input, or the terminal browser requirements in [#1617]. The terminal build, compatibility tests, documentation, notices, and regression tests are otherwise connected to the upgrade or its validation.

Resolution

Remove the unrelated scripts/usage-regression.ts change from this pull request, or move it to a separate pull request.

Full details: Linked Issues check

Explanation

For [#1617], the PR evidence supports the core upgrade. It reports intact DEC mode 2026 blocks, mixed renders on xterm 5.5, zero mixed or open-block renders on xterm 6, compatible addon pins, the xterm patch port, and parser-state coverage. The evidence does not establish that the full terminal browser lane passed. The PR states that the full local lane was still running and lists only selected browser checks. The evidence also does not establish coverage for every required bracket edge case, including malformed parameters, replay truncation, observer join, disconnect inside a bracket, and missing-close recovery.

Resolution

Provide a completed browser-lane result and test evidence for the required split, multi-bracket, malformed-parameter, late-join, replay-truncation, observer-join, disconnect, and missing-close scenarios. The available evidence is insufficient to determine full compliance.

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.

…ed without it

The slow case released the held JetBrains Mono face as soon as the font effect gave up waiting for it, then took the first attach frame. The attach follows that moment by about a millisecond, but under load it can come later, and the face then arrives first: the pane attaches at the face's grid with nothing left to resize, and the test failed on an outcome that is correct. With xterm.js 6 this happened in 1 of 5 local runs (attach 83 ms after the effect gave up) and once in the browser lane. The face is now released only after the attach was sent, so an attach that waited for the face would still fail the test.
@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Browser lane results. CI's browser regression jobs (ui-regression and every other script) passed on 5626ad4, along with every other check; CodeRabbit had no actionable comments.

The local full-lane run hit one more race, now fixed in 98fb4c1 (test-only):

  • Where: terminal-bundled-mono-regression.ts, slow-face case.

  • What it did: the test released the held JetBrains Mono face as soon as the font effect gave up waiting for it, then took the first attach frame. The attach normally follows that moment by about 1 ms, so it goes out at the fallback's grid and is resized once for the face's.

  • Measured (page time from the effect giving up to the attach frame, 5 runs each):

    gap in ms first attach
    xterm 5.5 1.2, 3.6, 1.8, 3.1, 0.9 132x35 every time
    xterm 6.0 1.7, 83.3, 1.0, 1.0, 1.0 110x39 in the 83 ms run (the face had already arrived), 132x35 otherwise

    It happened once in the local lane too. The outcome is correct: the pane attaches at the face's grid with nothing left to resize. But the test expected a resize.

  • Fix: the face is now let go only after the attach has been sent. An attach that waited for the face would still fail the test, by timing out. 4 of 4 local runs pass.

I could not tie the occasional 83 ms to one cause: attach() runs from the same font promise and is synchronous. It only moves when the pane attaches, by a fraction of a second, and only when the bundled face is slower than the font wait.

@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Merging 98fb4c1 (refs #1617; the owner's go for 0.4.20). Upgrades xterm.js to 6.0.0, whose synchronized-output support ends torn half-frames: on a real herdr pane 0 of 82 renders were mixed on 6.0 (3 runs) against 26-46 per run on 5.5. The repo's xterm patch is ported (3 of 34 hunks by hand) and keeps 5.5's Option/Alt+arrow word moves and its one-report-per-row trackpad scroll speed; it also fixes a flaky #2309 usage test. Strict review by the merge pass (dependency + patch). Supply chain: exact pins, registry integrity verified, and bun.lock changes only @xterm/xterm 5.5.0 -> 6.0.0, @xterm/addon-fit 0.10.0 -> 0.11.0 and @xterm/addon-web-links 0.11.0 -> 0.12.0; no new dependencies or install scripts. 8,566 tests, typecheck and build pass; nine browser scripts pass, including the IME replays; the lane checked native Korean typing byte-identical to main on Mac Safari, iOS Simulator Safari, the iOS app and Windows Chromium + MS IME, and the Windows CI steps. Bundle: +86 KB raw (+3.9%), +24 KB gzip (+3.6%). The last commit only reorders an attach in a test script. Known limit, not fixed here to keep the release moving (follow-up #2336): 6.0 accelerates the wheel for Ctrl as well as Alt, so Ctrl+wheel in a mouse-reporting application sends twice as many reports as on 5.5. Native Android typing was not re-run by the merge pass.

@devswha
devswha merged commit bd67663 into main Oct 29, 2026
22 checks passed
@devswha
devswha deleted the feat/xterm-6 branch October 29, 2026 08:15
@devswha devswha mentioned this pull request Oct 29, 2026
5 tasks
devswha added a commit that referenced this pull request Oct 29, 2026
## Release 0.4.20

The release PR, prepared by step 1 of
[docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing),
initially on main `bd676637a16471e8744d62c7311026ddb43a39eb` (#2335,
xterm 6), then merged with final-scope main
`ef482f2e66b3344658fb548fa1110744a92929c9` (#2338) and test-only
follow-up main `269e9ce19558b8d197959250075da56b25b9668f` (#2345):

- **Version:** `version` is 0.4.20 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.20` initially folded
122 fragments into the 2026-10-29 section of `CHANGELOG.md`, linked
their PRs, and deleted the fragments. After merging main, the modified
`letta-native-chat.md` from #2338 was folded by hand with its current
wording and PR link. No other late fragment landed; `changelog.d` holds
only `README.md`. Four additional entries for external PRs without their
own fragments bring the section to 157 entries.
- Added 22 `by @login` credits across all 19 outside-contributor PRs in
the release range. Preserved the existing credit to @Yoonwoo-Ha for
#1634. See the complete ancestry-based audit below.
- **Release summaries:** en, ko, ja and zh each have 5 new, 5 improved
and 5 fixed lines, matching 0.4.19's shape. They include the xterm 6
improvement: terminal frames no longer mix old and new output. Every
English line is at most 80 characters.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 38 to 39 because
the bundle inputs changed since remote-v38.
- **Telemetry:** the guard confirms no Worker deploy or deployed
fingerprint update is needed.
- **iOS upload note:** CURRENT_PROJECT_VERSION raised to 3 for App and
OvisNotifications (last uploaded: 2, source: `docs/native-app.md:99`,
commit `54fdadc1c65da5d50a6afef411e3ed8f23b6c255`). Both targets inherit
project-level Debug and Release settings, and every
`CURRENT_PROJECT_VERSION` entry is 3. `app/store/ios.md` now records the
prepared build. This is the last documented upload, not a live App Store
Connect query; check for later uploads before uploading. The marketing
version remains 1.0.
- The changelog explicitly distinguishes delivery: removing WebKit's
form bar (#2109) requires the new iOS app build, while Korean
composition (#2307) comes with the PC update and needs no new iOS build.
The Korean-input summary says the same in all four languages, with no
change to list counts.

## Validation

- Final `dori heavy release-check -- bun run check fast`: passed, exit
0; workflow syntax, generated types/themes, typecheck, build and unit
suite (8,591 pass, 0 fail, 34 platform skips in 549 files). This is the
merged tree containing #2338, #2345, the contributor corrections and iOS
build 3.
- `bun test scripts/changelog-fold.test.ts
server/release-notes.test.ts`: 33 pass, 0 fail.
- `bun scripts/release-notes.ts 0.4.20`: passed, with all patch-note
lists and the full changelog.
- `bun scripts/release-guards.ts` and CI mode with `--base
ef482f2`: passed on the final merged
tree: "Release 0.4.20: remote bundle, telemetry Worker and release
metadata are in order."
- `bun scripts/release-guards.ts --release 0.4.20`: expected exit 1 only
because "remote-v39 is not published." The merge pass publishes it after
merging.

## Merge pass

**Do not merge before the owner's OK.**

- [ ] Merge only after the owner's OK and required checks pass.
- [ ] After merging, push `remote-v39` on the merged commit and wait for
the **Remote PC bundles** workflow to publish the manifest and all
archives.
- [ ] Then run **Release** on `main` with version `0.4.20`, without `v`.
The Release workflow creates the app tag; do not push it by hand.
- [ ] From this PR's merge until the Release run is done, merge nothing
touching `server/`, `shared/`, `bun.lock` or `patches/`.
- [ ] A changelog fragment merged after this PR must be moved into
0.4.20 by hand.

This lane stops at the open PR. No tag, workflow dispatch, merge or
telemetry deploy was performed.

**Completed release follow-up:** merged main `ef482f2e` including #2338
(`fix/letta-no-live-box`), folded its revised fragment into 0.4.20, and
retained the contributor-credit commit `184dc120` and iOS-build commit
`0ffa3d45`. The Letta summary already describes conversation support
without promising a live-terminal box, so it needs no change.

Merged test-only #2345 from main `269e9ce1`: the two usage browser
checks now wait for the earlier shared account-order save and start the
sign-in check from a cleared order. No product behavior or late fragment
was added; `changelog.d` still contains only `README.md`. The iOS
delivery clarification and resolved review thread are retained.

## Complete external-contributor audit

Checked every merged PR whose merge commit is in `git log
v0.4.19..origin/main`: 133 PRs through final-scope main `ef482f2e`, or
134 including test-only #2345 on `269e9ce1`, with 19 PRs by 12 external
non-bot authors. Both rescans found no additional external-author gaps;
#2345 is by the maintainer. Added the four missing entries: #2271 and
#2274 by @CharleoYang, #2290 by @DravenDou, and #2282 by @fivetaku. The
tab-reopening summary now includes the history-page improvement in all
four languages; list counts remain 5/5/5.

Full external PR list checked: #1911 @jjsteffen; #2068 @YuuuXie; #2072
@Noobear; #2087 @JJLiebig; #2145 @mattmarcin; #2176 @jpcarranza94; #2231
@philipprass-prog; #2235 @vuongnmhvn; #2270, #2271, #2274 @CharleoYang;
#2278 @jpcarranza94; #2282 @fivetaku; #2283, #2292, #2293 @YuuuXie;
#2301 @jpcarranza94; #2321 @kilhyeonjun. Every PR has a linked `by
@login` credit in 0.4.20.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
devswha added a commit that referenced this pull request Oct 29, 2026
## Change

Ovis 0.4.20 can show a black frame around a light terminal after the
xterm.js 6 upgrade (#2335). xterm 6 sets the theme background on its new
scrollable element, while the legacy `.xterm-viewport` keeps its black
CSS background. Ovis's 8px terminal gutter exposes that layer.

Set the viewport background to the existing `--term-bg` token. The
gutter then follows the active terminal theme. Add a real-browser
regression that opens the terminal in light mode and compares the
viewport and terminal host backgrounds, plus a changelog fragment.

The visual approach follows VS Code's integrated terminal: the terminal
container uses the terminal theme background. This change keeps Ovis's
existing layout and uses its own theme token; it copies no code from
another project.

## Validation

- The regression failed against the original 0.4.20 client: the viewport
was `rgb(0, 0, 0)` while the light terminal host was `rgb(250, 248,
243)`.
- `bun run check fast` with proxy environment variables removed:
workflow syntax, generated files, typecheck, and production build pass.
Unit tests: **8600 passed, 17 failed, 36 skipped**. The 17 failures are
in `server/repo-diff.test.ts` and `server/legacy-env.test.ts`: this
container has Git 2.25.1, which rejects their `git init -b main`. The
same 17 failures reproduce on unmodified upstream commit
`8a3bc90e4c332aaa974b765568a938104d0285f9`.
- Proxy variables are removed only for the local check processes so
fixture HTTP and Unix-socket requests stay local; no product code or
machine configuration changed.
- `bun run check run bun scripts/terminal-viewport-regression.ts` with
proxy variables removed: **passed** on the current upstream checkout,
using the Node PTY host. Covers the light-theme gutter, native paging,
search highlights, wide cells, non-jumping refresh, and old bridge
compatibility.
- Headless desktop (842px) and phone (390px) checks pass through light,
dark, and light theme changes.
- `git diff --check` passes.

---------

Signed-off-by: joyn <[email protected]>
Co-authored-by: joyn <[email protected]>
Co-authored-by: devswha <[email protected]>
devswha added a commit that referenced this pull request Oct 29, 2026
…re xterm.js 6 (#2336) (#2357)

## 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 #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 #2355.
devswha added a commit that referenced this pull request Oct 30, 2026
…Mac) (#1168) (#2348)

## Change

A bare file name in a terminal pane (`11_two-version-design.md`, no
folder in it) can now be opened from the terminal, the way VS Code's
integrated terminal does it (the design follows VS Code; iTerm2 also
opens a name on Cmd+click):

- While Cmd is held (Ctrl off a Mac), a bare name under the pointer is
underlined and gets the pointer cursor. A Cmd+click (Ctrl+click) opens
it in the file viewer.
- The name is looked up the way the chat's bare names already are: the
existing `GET /api/fs/stat` lookup in the pane's folder, then a bounded
walk under it (`locateFile`, at most 10 matches). If several files have
that name, the viewer lists them to choose from. It never picks one on
its own.
- Without the key, a bare name stays plain text: a plain click or a tap
still lands on the terminal (and on a program that reads the mouse), as
before. `ls` and `git status` print bare names everywhere, so a plain
click must not open the viewer.
- A path with a folder in it still opens on a plain click.
- Dotted code names (`process.env`, `Math.random`) stay text: the chat's
`CODE_NAME` list is reused (`isCodeName` is now exported from
`src/lib/filePaths.ts`).
- On a phone, the viewer's list of choices now wraps long paths. Before,
`.btn`'s `white-space: nowrap` cut both ends of each path, including the
folder that tells the choices apart.

The change is client-only: no server, HTTP or WS contract change, and
nothing in the remote bundle moves.

Based on @bricks-8's fork branch (`feat/bare-file-name-links`), rebuilt
on the current `useTerminalMount.ts`. Thank you for the report and the
design.

Closes #1168

## How it works

`bareNameLinks` (src/lib/terminalFileLinks.ts) tracks the key through
window `keydown`/`keyup`/`mousemove` listeners (capture phase, with no
`preventDefault`) and resets on window `blur`. xterm 5.5's Linkifier
replaces a hovered link's `decorations` with its own object, whose
setters redraw the link hovered at that moment. So only the hovered bare
name's decorations are written, and only from its own `hover`. That
keeps a folder link the pointer moved on to drawn. It also covers a bare
name hovered again on the same row, which xterm reads back from that
object.

A Cmd/Ctrl+click on a drawn link sets the pointer cursor, so the
existing `onMouseDown` check keeps it from being forwarded to a program
that reads the mouse. The phone and narrow-screen fold tap path treats
bare names as links only when the key is pressed.

## Tests

- `src/lib/terminalFileLinks.test.ts`, which failed before the change:
- A bare name opens only on Cmd+click on a Mac and Ctrl+click elsewhere.
It is drawn only while the key is held. A folder path still opens on a
plain click. Code names and versions stay text.
- An xterm stand-in reads, swaps and re-reads decorations as Linkifier
does. It re-hovers the same link with the key changed while the pointer
was away, in both directions. This test failed on the first version of
the fix.
- `scripts/terminal-file-links-regression.ts` (browser, isolated test
session):
- With the key held the pointer appears, and it goes when the key is
released.
  - Ctrl+click on `README.md` opens it.
- `access.ts` lists `server/access.ts` and `shared/access.ts`, and a
choice opens one.
  - A plain click and a 390px tap open nothing.
- `bun run check fast` green on the branch merged with main after 0.4.20
(xterm 6.0.0): unit 8593 pass, 0 fail; the browser regression above
passes on that tree too.

## Review

Two reviewers, omo-native-code-reviewer and Codex Sol 6.1 Fast xhigh,
reviewed the change adversarially.

- Both found the same HIGH on the first head. When the pointer left a
bare name and came back on the same row after the key changed, the name
kept its old drawing. A plain click on it was then not forwarded to a
mouse-reading program, or a Cmd/Ctrl+click was forwarded. Fixed in the
second commit with a test that fails on the old code.
- Both approved the fix with no CRITICAL, HIGH or MEDIUM findings.

## Known limits (LOW, not fixed)

- With the key held, dotted names that are not files but have a
letter-only "extension" (`github.com`, `node.js`) are drawn as links
too. A click on one ends in "No readable file at this path". The chat's
code-span reading has the same limit.
- Off a Mac, holding Ctrl for a shortcut (Ctrl+C) briefly underlines a
bare name under the pointer. This is only visual: shortcuts are
untouched.
- In a program that reads the mouse, a Cmd/Ctrl+click on a bare name
opens the file, and the program does not get that click (vim with
`mouse=a` uses Ctrl+click to jump to a tag). herdr's attach reports the
mouse for every pane, so nothing tells such a program from a shell. This
is the rule web and folder links already follow for a plain click; a
bare name takes only the key-click. A plain click on a bare name, and a
Ctrl+click anywhere else, still reach the program
(`scripts/terminal-arrows-clicks-regression.ts`).
- The unit test's xterm stand-in mirrors xterm 5.5's Linkifier. xterm
6.0.0, which open PR #2335 moves to, has the same
`_handleNewLink`/`_linkHover` code, so the fix and the stand-in still
match. The two PRs share no files. Re-check the stand-in on later xterm
upgrades.

## Screenshots

These were taken on the isolated test session, Codex theme, at 1280 and
390 in dark and light, and sent to the maintainer through Dori.

---------

Co-authored-by: jaemoo lee <[email protected]>
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.

Terminal: prove whether xterm.js 6 synchronized output fixes tearing, then upgrade or close

1 participant