mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
config: change osc-color-report-format enum
This commit is contained in:
@ -315,11 +315,11 @@ keybind: Keybinds = .{},
|
||||
/// Allowable values are:
|
||||
///
|
||||
/// * "none" - OSC 10/11 queries receive no reply
|
||||
/// * "bits8" - Color components are return unscaled, i.e. rr/gg/bb
|
||||
/// * "bits16" - Color components are returned scaled, e.g. rrrr/gggg/bbbb
|
||||
/// * "8-bit" - Color components are return unscaled, i.e. rr/gg/bb
|
||||
/// * "16-bit" - Color components are returned scaled, e.g. rrrr/gggg/bbbb
|
||||
///
|
||||
/// The default value is "bits16".
|
||||
@"osc-color-report-format": OSCColorReportFormat = .bits16,
|
||||
/// The default value is "16-bit".
|
||||
@"osc-color-report-format": OSCColorReportFormat = .@"16-bit",
|
||||
|
||||
/// If anything other than false, fullscreen mode on macOS will not use the
|
||||
/// native fullscreen, but make the window fullscreen without animations and
|
||||
@ -1500,6 +1500,6 @@ pub const ShellIntegration = enum {
|
||||
/// OSC 10 and 11 default color reporting format.
|
||||
pub const OSCColorReportFormat = enum {
|
||||
none,
|
||||
bits8,
|
||||
bits16,
|
||||
@"8-bit",
|
||||
@"16-bit",
|
||||
};
|
||||
|
@ -1820,7 +1820,7 @@ const StreamHandler = struct {
|
||||
|
||||
var msg: termio.Message = .{ .write_small = .{} };
|
||||
const resp = switch (self.osc_color_report_format) {
|
||||
.bits16 => try std.fmt.bufPrint(
|
||||
.@"16-bit" => try std.fmt.bufPrint(
|
||||
&msg.write_small.data,
|
||||
"\x1B]{s};rgb:{x:0>4}/{x:0>4}/{x:0>4}{s}",
|
||||
.{
|
||||
@ -1832,7 +1832,7 @@ const StreamHandler = struct {
|
||||
},
|
||||
),
|
||||
|
||||
else => try std.fmt.bufPrint(
|
||||
.@"8-bit" => try std.fmt.bufPrint(
|
||||
&msg.write_small.data,
|
||||
"\x1B]{s};rgb:{x:0>2}/{x:0>2}/{x:0>2}{s}",
|
||||
.{
|
||||
@ -1843,6 +1843,8 @@ const StreamHandler = struct {
|
||||
terminator.string(),
|
||||
},
|
||||
),
|
||||
|
||||
.none => unreachable, // early return above
|
||||
};
|
||||
msg.write_small.len = @intCast(resp.len);
|
||||
self.messageWriter(msg);
|
||||
|
Reference in New Issue
Block a user