this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(windows): unbreak escape sequence handling

authored by

CJ van den Berg and committed by
Tim Culverhouse
1e5d39d9 c4b53722

+4 -3
+4 -3
src/windows/Tty.zig
··· 166 166 167 167 const base_layout: u16 = switch (event.wVirtualKeyCode) { 168 168 0x00 => blk: { // delivered when we get an escape sequence or a unicode codepoint 169 + if (state.ansi_idx == 0 and event.uChar.AsciiChar != 27) 170 + break :blk event.uChar.UnicodeChar; 169 171 state.ansi_buf[state.ansi_idx] = event.uChar.AsciiChar; 170 172 state.ansi_idx += 1; 173 + if (state.ansi_idx <= 2) return null; 171 174 switch (state.ansi_buf[1]) { 172 175 '[' => { // CSI, read until 0x40 to 0xFF 173 - if (state.ansi_idx <= 2) return null; 174 176 switch (event.uChar.UnicodeChar) { 175 177 0x40...0xFF => { 176 178 return .cap_da1; ··· 197 199 else => return null, 198 200 } 199 201 }, 200 - else => {}, 202 + else => return null, 201 203 } 202 - break :blk event.uChar.UnicodeChar; 203 204 }, 204 205 0x08 => Key.backspace, 205 206 0x09 => Key.tab,