fix: do not break out of bracketed paste on sanitizer fail

Log and drop the bad bytes instead.
This commit is contained in:
CJ van den Berg 2024-09-05 16:39:51 +02:00
parent d286aae67a
commit 929f6b50b3
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -298,8 +298,9 @@ fn handle_bracketed_paste_input(self: *Self, cbor_msg: []const u8) !bool {
const bytes = try ucs32_to_utf8(&[_]u32{egc_}, &buf);
try self.bracketed_paste_buffer.appendSlice(buf[0..bytes]);
} else {
try self.handle_bracketed_paste_end();
return false;
var buf: [6]u8 = undefined;
const bytes = try ucs32_to_utf8(&[_]u32{egc_}, &buf);
self.logger.print("unexpected codepoint in paste: {d} {s}", .{ keypress, buf[0..bytes] });
},
}
return true;