Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Made some progress on putting renderables onto the main scrollback buffer in OpenTUI. Still have some work left on the internals, but making progress. We want to make this direct render mode available as `opencode run --interactive` - as a minimal mode that is optimized for embedding OpenCode or...

19,192 Aufrufe • vor 6 Monaten •via X (Twitter)

6 Kommentare

Profilbild von Миша Љевћенко
Миша Љевћенкоvor 6 Monaten

This + cc's vim mode would be a killer

Profilbild von Simon Klee
Simon Kleevor 6 Monaten

Exactly. Have been testing the vim oc plugin and it would benefit from this mode

Profilbild von Tommy D. Rossi
Tommy D. Rossivor 6 Monaten

awesome. I would call it --scrollback

Profilbild von Luke Parker
Luke Parkervor 6 Monaten

Dude this is awesome

Profilbild von مُحَمَّد 🍉
مُحَمَّد 🍉vor 6 Monaten

liked the footer much better than the existing one

Profilbild von Simon Klee
Simon Kleevor 6 Monaten

Oh no, this is just my testbed in OpenTUI. @iamdavidhill does the design and it will be on brand 😉

Ähnliche Videos

Got flash banged by OpenCode recently? Yeah, that was me. Here's what happened: OpenCode/OpenTUI detects terminal theme mode (light or dark) by querying OSC 10/11 for the terminal’s foreground/background colors and deriving the mode from those values. OpenTUI also enables DEC Private Mode 2031 to receive theme-change notifications. When that mode is enabled, terminals can send CSI 997 when the system theme changes. OpenTUI treated the 997 payload as authoritative and let it override the OSC 10/11-derived result. That turned out to be wrong. In some terminals, the 997 payload is simply unreliable: it can report light while the queried terminal colors clearly indicate a dark theme. That’s what caused the flash bangs. The fix seemed straightforward: stop trusting the 997 payload as the actual theme mode and use it only as a trigger to re-query OSC 10/11, then derive the mode from the returned foreground/background colors. That works great. Except OpenTUI had also started using OSC 11 to set the terminal’s default background color, so the terminal gutter around the drawn TUI matched the app background instead of the terminal’s own default background. This was introduced recently in OpenTUI. That created a new problem: if you use OSC 11 to override the terminal background, then later query OSC 11, you are just reading back your own override instead of the terminal’s real theme background. No problem. Reset the terminal background with OSC 111, query OSC 10/11, derive the mode, then restore the renderer background again. Oh wait. Turns out Ghostty has a bug. Once this background reset/override path is used, later OSC 11 background reporting can get stuck and stop tracking system theme changes correctly. Even though theme-change notifications still fire and OSC 10 foreground updates continue. This would cause further issues where the OSC 10/11 derivation would be wrong again. So for now: no using OSC 11 to set the terminal background color just to fill the gutter. TL;DR: OpenTUI must treat CSI 997 only as a hint that the terminal theme may have changed and rely exclusively on OSC 10/11 color queries for actual theme mode detection, while avoiding terminal background mutation via OSC 11/111 because that breaks correctness in some terminals like Ghostty.

kmdr

30,311 Aufrufe • vor 5 Monaten