terminal: bring back unimplemented logs

This commit is contained in:
Mitchell Hashimoto
2023-10-26 09:53:57 -07:00
parent 99591f280b
commit 0baf3522b4

View File

@ -970,14 +970,14 @@ pub fn Stream(comptime Handler: type) type {
if (@hasDecl(T, "changeWindowTitle")) { if (@hasDecl(T, "changeWindowTitle")) {
try self.handler.changeWindowTitle(title); try self.handler.changeWindowTitle(title);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.clipboard_contents => |clip| { .clipboard_contents => |clip| {
if (@hasDecl(T, "clipboardContents")) { if (@hasDecl(T, "clipboardContents")) {
try self.handler.clipboardContents(clip.kind, clip.data); try self.handler.clipboardContents(clip.kind, clip.data);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.prompt_start => |v| { .prompt_start => |v| {
@ -987,35 +987,35 @@ pub fn Stream(comptime Handler: type) type {
.continuation => try self.handler.promptContinuation(v.aid), .continuation => try self.handler.promptContinuation(v.aid),
} }
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.prompt_end => { .prompt_end => {
if (@hasDecl(T, "promptEnd")) { if (@hasDecl(T, "promptEnd")) {
try self.handler.promptEnd(); try self.handler.promptEnd();
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.end_of_input => { .end_of_input => {
if (@hasDecl(T, "endOfInput")) { if (@hasDecl(T, "endOfInput")) {
try self.handler.endOfInput(); try self.handler.endOfInput();
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.end_of_command => |end| { .end_of_command => |end| {
if (@hasDecl(T, "endOfCommand")) { if (@hasDecl(T, "endOfCommand")) {
try self.handler.endOfCommand(end.exit_code); try self.handler.endOfCommand(end.exit_code);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.report_pwd => |v| { .report_pwd => |v| {
if (@hasDecl(T, "reportPwd")) { if (@hasDecl(T, "reportPwd")) {
try self.handler.reportPwd(v.value); try self.handler.reportPwd(v.value);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.mouse_shape => |v| { .mouse_shape => |v| {
@ -1027,17 +1027,20 @@ pub fn Stream(comptime Handler: type) type {
try self.handler.setMouseShape(shape); try self.handler.setMouseShape(shape);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
.report_default_color => |v| { .report_default_color => |v| {
if (@hasDecl(T, "reportDefaultColor")) { if (@hasDecl(T, "reportDefaultColor")) {
try self.handler.reportDefaultColor(v.kind, v.terminator); try self.handler.reportDefaultColor(v.kind, v.terminator);
return; return;
} } else log.warn("unimplemented OSC callback: {}", .{cmd});
}, },
else => {}, else => if (@hasDecl(T, "oscUnimplemented"))
try self.handler.oscUnimplemented(cmd)
else
log.warn("unimplemented OSC command: {}", .{cmd}),
} }
// Fall through for when we don't have a handler. // Fall through for when we don't have a handler.