mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
termio: report color scheme synchronously
The reporting of color scheme was handled asynchronously by queuing a handler in the surface. This could lead to race conditions where the DSR is reported after subsequent VT sequences. Fixes #5922
This commit is contained in:
@@ -119,7 +119,7 @@ pub const StreamHandler = struct {
|
||||
};
|
||||
|
||||
// The config could have changed any of our colors so update mode 2031
|
||||
self.surfaceMessageWriter(.{ .report_color_scheme = false });
|
||||
self.messageWriter(.{ .color_scheme_report = .{ .force = false } });
|
||||
}
|
||||
|
||||
inline fn surfaceMessageWriter(
|
||||
@@ -871,7 +871,7 @@ pub const StreamHandler = struct {
|
||||
self.messageWriter(msg);
|
||||
},
|
||||
|
||||
.color_scheme => self.surfaceMessageWriter(.{ .report_color_scheme = true }),
|
||||
.color_scheme => self.messageWriter(.{ .color_scheme_report = .{ .force = true } }),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -956,7 +956,7 @@ pub const StreamHandler = struct {
|
||||
try self.setMouseShape(.text);
|
||||
|
||||
// Reset resets our palette so we report it for mode 2031.
|
||||
self.surfaceMessageWriter(.{ .report_color_scheme = false });
|
||||
self.messageWriter(.{ .color_scheme_report = .{ .force = false } });
|
||||
|
||||
// Clear the progress bar
|
||||
self.progressReport(.{ .state = .remove });
|
||||
|
||||
Reference in New Issue
Block a user