fix: stop libghostty stream logs from corrupting the boo ui viewport#65
Merged
Merged
Conversation
libghostty's VT stream parser logs unimplemented sequences at info level under the `stream` scope (e.g. "OSC 1 (change icon) received and ignored"). The session daemon redirects its stderr to BOO_LOG or /dev/null in startDaemon, so those lines never reach a terminal there. But `boo ui` renders in-process with stderr still attached to the user's terminal, so the same logs paint directly over the rendered viewport and corrupt it until a manual redraw (C-a l). Powerlevel10k makes this very visible: it emits an OSC 1 on every prompt and on preexec, so any command (e.g. `cat ~/.zshrc`) floods the pane with "received and ignored" lines. Install a std_options.logFn that drops info-and-below from the `stream` scope while leaving every other scope untouched. Verified at ReleaseSafe (the release build config) that this takes the emitted info(stream) count from 1 to 0; the change is zig fmt clean and `zig build test` passes.
kylecarbs
approved these changes
Jun 15, 2026
kylecarbs
left a comment
Member
There was a problem hiding this comment.
Thank you! Will publish a patch shortly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
boo uirenders its live viewport through an in-process libghosttystreamparser, and the UI runs in the user's terminal with stderr inherited. libghostty logs unimplemented sequences atinfolevel under thestreamscope (e.g.info(stream): OSC 1 (change icon) received and ignored), so those lines paint directly over the rendered pane and corrupt it until a manualC-a lredraw.The session daemon doesn't have this problem because
startDaemonalready redirects its stderr toBOO_LOG//dev/null. The in-process UI path has no equivalent guard.This is very visible with Powerlevel10k, which emits an
OSC 1on every prompt and onpreexec— socat ~/.zshrc(or any command) floods the viewport withreceived and ignoredlines.Fixes #64.
How
boo installs no
std_options, so logging uses Zig defaults. This adds astd_options.logFnthat dropsinfo-and-below from thestreamscope, leaving every other scope (.ui,.daemon,.window, …) untouched:A more targeted alternative would be to redirect the UI process's stderr the way the daemon does, but that would also hide genuinely useful
warn/erroutput; filtering onlyinfo(stream)keeps everything else visible.Verification
Built v0.5.18 from source (Zig 0.15.2) and drove a session emitting one
OSC 1, capturingBOO_LOG:info(stream)linesReleaseSafe, beforeReleaseSafe, after (this PR)zig fmt --check build.zig build.zig.zon src test— cleanzig build test— passeszig build -Doptimize=ReleaseSafe— compilesConfirmed the cause is independent of optimize mode (both
DebugandReleaseSafeemitinfo(stream)without the filter), so this is the right lever rather than a build-flag change.Notes
Opening as a draft for maintainer direction on the preferred approach (logFn filter vs. UI stderr redirect vs.
log_scope_levels). Also — thanks for boo; the libghostty-backed state model and the automation surface are a pleasure to work with.