Skip to content

chore(pi-tui): sync vendored pi-tui to upstream v1.3.0 - #380

Merged
elkaix merged 3 commits into
mainfrom
chore/pi-tui-sync-v1.3.0
Oct 15, 2026
Merged

elkaix merged 3 commits into
mainfrom
chore/pi-tui-sync-v1.3.0

Conversation

@elkaix

@elkaix elkaix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Requirement or Bug

Sync the vendored packages/pi-tui to upstream earendil-works/pi v1.3.0 (from v1.0.1).

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

Three-way merge per file from the old sync point a7229ddc (v1.0.1) to 71023aec (v1.3.0), keeping fork divergences. UPSTREAM.md records the new sync point.

  • 31 upstream files: 27 merged cleanly, 2 added (program-status.ts and its test), 4 had conflicts that I resolved by hand:
    • README.md: upstream text, with our @pymodel/pi-tui package name.
    • src/terminal-image.ts: upstream Herdr detection, with bracket process.env['KITTY_WINDOW_ID'].
    • test/editor.test.ts, test/tui-render.test.ts: kept both fork and upstream imports and tests.
  • Strict-type fix: process.env['PI_PROGRAM_STATUS'] (TS4111).
  • Upstream made Terminal.setProgramStatus() required, so 7 app test stubs gained a no-op.
  • docs/reference/keyboard.md: documented the Home/End and Ctrl-Home/Ctrl-End keys.
  • Check: diff -rq against the upstream tag lists the same 56 divergent files as before the sync, so no new drift. Upstream did not change the native sources or prebuilds in this range.

Upstream highlights (v1.0.3 to v1.3.0): Program Status Protocol (OSC 7501), renderFakeCursor(), a fix for fragmented terminal color replies leaking hex into the prompt, Herdr image and link support, shifted-symbol key bindings, Box/Text.setPaddingX, and overlay cursor and wheel-scroll fixes.

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Home / End, fullscreen mode Scroll the transcript to top/bottom Move the input cursor to line start/end Fullscreen users who scroll with Home/End Use Ctrl-Home / Ctrl-End
Ctrl-Home / Ctrl-End, fullscreen Move the input cursor to line start/end Scroll the transcript to top/bottom Few; Home/End/Ctrl-A/Ctrl-E still move the cursor Home/End
Ctrl-Home / Ctrl-End, inline mode Move the input cursor to line start/end No action Users of the Ctrl variants in inline mode Home/End/Ctrl-A/Ctrl-E
Focused input cursor with showHardwareCursor Fake reverse-video cursor plus hardware cursor Hardware cursor only Not enabled by this app n/a
Terminal startup query Kitty + DA queries Also queries OSC 7501 support; status reports only if the terminal answers All TUI users PI_PROGRAM_STATUS=0
Terminal color replies split across reads Could leak hex into the prompt and open the external editor Buffered and parsed Nobody n/a

Affected modules: packages/pi-tui (ships inside the CLI) and apps/pythinker-code tests. Coverage:

  • pi-tui node --test: 1143 pass, 0 fail, 1 skipped (main also skips 1). This includes upstream's new tests for program status, stdin buffering, keys, fake cursor, and alt screen.
  • App: tsc and tsgo clean; vitest 4170 passed, 2 skipped.
  • Live: pnpm dev:cli in tmux; typing hello, then Home, then X gives Xhello.
  • Note: oxlint reports 0 files for packages/pi-tui, so the package is not linted.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Three-way merge from v1.0.1 (a7229ddc) to v1.3.0 (71023aec). Keeps the
fork divergences; the set of files that differ from upstream is unchanged.
Adds Terminal.setProgramStatus stubs to app test terminals.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: PyModel/pythinker-code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be932ac4-647b-4806-a3f5-6cb87c234110
📥 Commits

Reviewing files that changed from the base of the PR and between bde2ec7 and b29d0ea.

📒 Files selected for processing: 39
  • .changeset/pi-tui-upstream-v1-3-0.md
  • apps/pythinker-code/test/tui/components/dialogs/agent-activity-viewer.test.ts
  • apps/pythinker-code/test/tui/components/dialogs/approval-preview.test.ts
  • apps/pythinker-code/test/tui/controllers/notify.test.ts
  • apps/pythinker-code/test/tui/task-output-viewer.test.ts
  • apps/pythinker-code/test/tui/tasks-browser.test.ts
  • apps/pythinker-code/test/tui/tui-frame.bench.ts
  • apps/pythinker-code/test/tui/utils/screen-takeover.test.ts
  • docs/reference/keyboard.md
  • packages/pi-tui/README.md
  • packages/pi-tui/UPSTREAM.md
  • packages/pi-tui/src/components/box.ts
  • packages/pi-tui/src/components/editor.ts
  • packages/pi-tui/src/components/input.ts
  • packages/pi-tui/src/components/text.ts
  • packages/pi-tui/src/index.ts
  • packages/pi-tui/src/keybindings.ts
  • packages/pi-tui/src/keys.ts
  • packages/pi-tui/src/program-status.ts
  • packages/pi-tui/src/stdin-buffer.ts
  • packages/pi-tui/src/terminal-image.ts
  • packages/pi-tui/src/terminal.ts
  • packages/pi-tui/src/tui-alt-screen.ts
  • packages/pi-tui/src/tui-main-screen.ts
  • packages/pi-tui/src/tui.ts
  • packages/pi-tui/src/utils.ts
  • packages/pi-tui/test/alt-screen-large-transcript-bench.ts
  • packages/pi-tui/test/editor.test.ts
  • packages/pi-tui/test/keybindings.test.ts
  • packages/pi-tui/test/keys.test.ts
  • packages/pi-tui/test/program-status.test.ts
  • packages/pi-tui/test/render-churn-bench.ts
  • packages/pi-tui/test/stdin-buffer.test.ts
  • packages/pi-tui/test/terminal-colors.test.ts
  • packages/pi-tui/test/terminal-image.test.ts
  • packages/pi-tui/test/terminal.test.ts
  • packages/pi-tui/test/tui-alt-screen.test.ts
  • packages/pi-tui/test/tui-render.test.ts
  • packages/pi-tui/test/virtual-terminal.ts
  • 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@b29d0ea
npx https://pkg.pr.new/@pymodel/pythinker-code@b29d0ea

commit: b29d0ea

@elkaix
elkaix enabled auto-merge (squash) October 15, 2026 23:35
@elkaix
elkaix merged commit bb2780d into main Oct 15, 2026
25 checks passed
@elkaix
elkaix deleted the chore/pi-tui-sync-v1.3.0 branch October 15, 2026 23:42
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.

1 participant