Repository navigation
v1.0.21
Code blocks highlight again after resuming a session
After resuming, forking, or switching to a session, its ```text and ```yaml blocks (and code inside thinking) stayed dim and unhighlighted with the theme, while Pi without the theme highlights them. This release fixes that, and the README gallery now shows the block Pi logo.
Fixed
-
Stale highlight cache. Pi registers a few syntax grammars at startup, loads the rest in the background, and then repaints. Blocks drawn before that (a resumed session draws its history immediately) fall back to the plain code-block color. The theme memoizes highlighting to keep streaming cheap, and it had cached that pre-load fallback and served it to the repaint. A result equal to the no-language fallback is no longer cached, so the repaint highlights it; highlighted results and blocks with no language are still served from the cache.
Measured in Pi 1.1.0 with the Titanium theme, a resumed session, foreground colors read back from the terminal buffer (same result on two runs each):
Block 1.0.20 1.0.20 with only the cache disabled Pi without the theme 1.0.21 ```textdim #9ca3b0default default default ```yamldim, unhighlighted highlighted highlighted highlighted code in thinking dim default default default ```bashdefault default default default ```(no language)dim dim dim dim -
Fenced blocks with no language keep Pi's
mdCodeBlockcolor by design, exactly as Pi renders them without the theme; in Titanium that color is the muted#9ca3b0. That is a palette choice, not part of this fix.
Changed
- The README gallery shows the block Pi brand logo in the welcome card:
media/welcome.pngand thegallery-preview.pngpreview, which is also the pi.dev package image. Only the logo region of each image was redrawn, on the capture's own character grid; a pixel diff against the previous images shows no change outside it. Image URLs move to?v=gallery-3so cached copies refresh.
How it stays contained
- Presentation only. The highlighter Pi provides is unchanged; the theme only stops caching the results that can still change.
- Every golden section is byte-identical to 1.0.20.
Verification
- CI: this repository has no configured GitHub Actions workflows, check-runs, or commit-status contexts for the release commit. The local release gates below all passed.
npm ciandnpm run check: typecheck, 410 unit/integration/golden tests (3 new cache tests: a grammar that loads after the first render, settled blocks still served from the cache, a language that never loads; the first and third fail on 1.0.20), dependency boundaries, production build, and package smoke.npm run test:e2e:readonly-tools: 25/25 packed-package CLI/RPC cases on Pi 0.99.1 withpi-hashline-edit-pro4.5.1.npm publish --dry-run: the expected 7-file npm artifact (148.0 kB packed).- Real TUI runs on Pi 1.1.0 with a deterministic local provider and an isolated agent directory,
claude-codepreset: a fresh answer and the same session resumed with-crendertext,bash,yaml, and thinking code exactly as Pi without the theme.
Tested on Windows x64 with Node 24.11.1. Linux/macOS runs were not part of this verification.
Install / update
Published on npm. The registry latest tag, gitHead (release commit), tarball shasum, a clean install whose bundle matches the release build byte for byte, and a real Pi 1.1.0 resume run of the installed package (text, yaml, and thinking code highlighted after -c) have been verified.
pi install npm:@nguyenquangthai/pi-omp-theme@1.0.21
# For an existing unpinned installation:
pi update npm:@nguyenquangthai/pi-omp-theme