Skip to content
PifeatureCLI & tooling7 files · +3128 −732

Render weather as a Kitty terminal background in Pi TUI

Session from pi-extensions-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

2h 08msession
2interventions
GOAL

Make the weather widget appear as an ambient background behind Pi's text instead of an overlay/widget, exploring terminal image layering options within Pi's TUI extension system.

  1. Prompt · +0
    Can we make the weather widget appear in Pi's background rather than as a widget/overlay?
  2. Agent did · +0m
    Investigated Pi's TUI/extension/theme APIs; concluded there's no true background layer and overlays composite on top, not behind, text.
  3. Intervention · +8m
    Developer recalled seeing a genuinely semi-transparent image in a separate pi-nes project and asked the agent to check how that worked instead of accepting 'not possible'.
    Why: I remembered actually seeing this work before, so I pushed back instead of accepting the 'terminal can't do this' answer — that's what unlocked the real solution (Kitty z=-1).
  4. Agent did · +24m
    Built WeatherBackground using Kitty graphics protocol at z=-1: extracted ansi-buffer.ts, created weather-bg.ts renderer, wired /weather-bg command into index.ts, verified via esbuild bundling.
  5. Fail · +40m
    No image appeared at all after toggling /weather-bg; widget-based positioning placed the image only near the bottom of the screen, mostly off-screen.
  6. Fail · +50m
    After switching to direct terminal writes, image still didn't render due to a cols/columns property name bug found via debug logging; once fixed, the image appeared but corrupted TUI layout and caused components to shift upward on every render.
  7. Agent did · +56m
    Moved rendering back into the widget cycle with C=1 cursor-lock, added zlib compression and 4x cell upscaling for resolution/perf, and created a custom 'weather' theme with transparent message backgrounds.
  8. Intervention · +1h 37m
    Developer reported borders still weren't showing, HUD fills flickering/duplicating background shapes, and explicitly told the agent not to patch Pi core.
    Why: The agent kept probing Pi's core rendering internals for a fix — I wanted to keep this scoped to our extension only, not touch core.
  9. Fail · +1h 52m
    After several rounds of z-index and pause/throttle fixes, footer widget still rendered inconsistently, input box shifted vertically, and message fills kept flickering during streaming.
  10. Agent did · +2h 6m
    Abandoned live-animated background approach in favor of a static snapshot mode (one-time weather capture rendered once as background), and wrote a retrospective doc of what was tried and learned.
  11. Outcome · +2h 8m
    Shipped static-snapshot weather background as /weather-bg, documented the live-animation investigation in .docs/weather-background-retrospective.md, excluded from npm package via .npmignore.
VERDICT

I'd start by asking directly whether Kitty's z-index image layering was available, since that's what ultimately worked — a lot of early exploration time went into overlay/theme APIs that were dead ends. The correction that did the work was pushing back on the agent's 'terminal can't do transparency' conclusion by pointing at a real prior example (pi-nes) instead of accepting it. In the end the live-animated background was too fragile (flicker, layout shifts, duplicate images) and we settled for a static snapshot, which I should have considered sooner given how much back-and-forth debugging the animated version took.

I tried this · 0

Discussion · 0

How Builds work