Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ const ui = @import("ui.zig");

pub const version = "0.5.18";

/// Route std.log through a filter. libghostty's VT stream parser logs
/// unimplemented sequences at info level under the `stream` scope (e.g.
/// "OSC 1 (change icon) received and ignored"). In `boo ui` the parser runs
/// in-process with stderr still attached to the user's terminal (unlike the
/// daemon, which redirects stderr in startDaemon), so those lines paint over
/// the rendered viewport and corrupt it. Drop info-and-below from `stream`;
/// every other scope logs as before.
pub const std_options: std.Options = .{
.logFn = filteredLog,
};

fn filteredLog(
comptime level: std.log.Level,
comptime scope: @TypeOf(.enum_literal),
comptime format: []const u8,
args: anytype,
) void {
if (scope == .stream and @intFromEnum(level) >= @intFromEnum(std.log.Level.info)) return;
std.log.defaultLog(level, scope, format, args);
}

/// Exit codes, documented in `boo help`.
const exit_runtime: u8 = 1;
const exit_usage: u8 = 2;
Expand Down
Loading