this repo has no description
13
fork

Configure Feed

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

fix: add workarounds mode with a fix for the conpty UL bug

authored by

CJ van den Berg and committed by
Tim Culverhouse
5f6c128b ead63d10

+14 -3
+13 -3
src/Vaxis.zig
··· 80 80 legacy, 81 81 } = .standard, 82 82 83 + /// Enable workarounds for escape sequence handling issues/bugs in terminals 84 + /// So far this just enables a UL escape sequence workaround for conpty 85 + enable_workarounds: bool = true, 86 + 83 87 state: struct { 84 88 /// if we are in the alt screen 85 89 alt_screen: bool = false, ··· 589 593 } 590 594 }, 591 595 .rgb => |rgb| { 592 - switch (self.sgr) { 596 + if (self.enable_workarounds) 597 + try tty.print(ctlseqs.ul_rgb_conpty, .{ rgb[0], rgb[1], rgb[2] }) 598 + else switch (self.sgr) { 593 599 .standard => try tty.print(ctlseqs.ul_rgb, .{ rgb[0], rgb[1], rgb[2] }), 594 600 .legacy => try tty.print(ctlseqs.ul_rgb_legacy, .{ rgb[0], rgb[1], rgb[2] }), 595 601 } ··· 1284 1290 } 1285 1291 }, 1286 1292 .rgb => |rgb| { 1287 - switch (self.sgr) { 1293 + if (self.enable_workarounds) 1294 + try tty.print(ctlseqs.ul_rgb_conpty, .{ rgb[0], rgb[1], rgb[2] }) 1295 + else switch (self.sgr) { 1288 1296 .standard => try tty.print(ctlseqs.ul_rgb, .{ rgb[0], rgb[1], rgb[2] }), 1289 - .legacy => try tty.print(ctlseqs.ul_rgb_legacy, .{ rgb[0], rgb[1], rgb[2] }), 1297 + .legacy => { 1298 + try tty.print(ctlseqs.ul_rgb_legacy, .{ rgb[0], rgb[1], rgb[2] }); 1299 + }, 1290 1300 } 1291 1301 }, 1292 1302 }
+1
src/ctlseqs.zig
··· 95 95 pub const fg_rgb_legacy = "\x1b[38;2;{d};{d};{d}m"; 96 96 pub const bg_rgb_legacy = "\x1b[48;2;{d};{d};{d}m"; 97 97 pub const ul_rgb_legacy = "\x1b[58;2;{d};{d};{d}m"; 98 + pub const ul_rgb_conpty = "\x1b[58:2::{d}:{d}:{d}m"; 98 99 99 100 // Underlines 100 101 pub const ul_off = "\x1b[24m"; // NOTE: this could be \x1b[4:0m but is not as widely supported