terminal: ignore SOH/STX, bash sends this for some reason

This commit is contained in:
Mitchell Hashimoto
2023-08-17 13:40:11 -07:00
parent a058bcbdb0
commit c8a07abdf3
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,10 @@
pub const C0 = enum(u7) {
/// Null
NUL = 0x00,
/// Start of heading
SOH = 0x01,
/// Start of text
STX = 0x02,
/// Enquiry
ENQ = 0x05,
/// Bell

View File

@ -76,7 +76,8 @@ pub fn Stream(comptime Handler: type) type {
defer tracy.end();
switch (@as(ansi.C0, @enumFromInt(c))) {
.NUL => {},
// We ignore SOH/STX: https://github.com/microsoft/terminal/issues/10786
.NUL, .SOH, .STX => {},
.ENQ => if (@hasDecl(T, "enquiry"))
try self.handler.enquiry()