OSC: clean up color_operation handling
parent
f2dfd9f677
commit
e0ddc7a2fa
|
|
@ -1201,6 +1201,9 @@ pub const StreamHandler = struct {
|
||||||
operations: *const terminal.osc.Command.ColorOperationList,
|
operations: *const terminal.osc.Command.ColorOperationList,
|
||||||
terminator: terminal.osc.Terminator,
|
terminator: terminal.osc.Terminator,
|
||||||
) !void {
|
) !void {
|
||||||
|
// return early if there is nothing to do
|
||||||
|
if (operations.count() == 0) return;
|
||||||
|
|
||||||
var buffer: [1024]u8 = undefined;
|
var buffer: [1024]u8 = undefined;
|
||||||
var fba: std.heap.FixedBufferAllocator = .init(&buffer);
|
var fba: std.heap.FixedBufferAllocator = .init(&buffer);
|
||||||
const alloc = fba.allocator();
|
const alloc = fba.allocator();
|
||||||
|
|
@ -1366,6 +1369,8 @@ pub const StreamHandler = struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (report) {
|
if (report) {
|
||||||
|
// If any of the operations were reports, finialize the report
|
||||||
|
// string and send it to the terminal.
|
||||||
try writer.writeAll(terminator.string());
|
try writer.writeAll(terminator.string());
|
||||||
const msg = try termio.Message.writeReq(self.alloc, response.items);
|
const msg = try termio.Message.writeReq(self.alloc, response.items);
|
||||||
self.messageWriter(msg);
|
self.messageWriter(msg);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue