summaryrefslogtreecommitdiff
path: root/dev/gui
diff options
context:
space:
mode:
Diffstat (limited to 'dev/gui')
-rw-r--r--dev/gui/gui.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 6cd97b69..9f6e4876 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -1555,10 +1555,13 @@ const StdinFeed = struct {
// finger;<kind>;<id>;<x>;<y>;<pressure>
// close: the window's close button
// One the read cut short, or what may yet begin one, waits for
- // the next read.
+ // the next read; but a read that ends in a lone ESC ends in the
+ // Escape key, as the tty's reader has a read of one ESC (a driver
+ // writes each key and event whole): held, it waited for the next
+ // write, which then came as Alt on its first key.
const rest = f.buf[seq_start..len];
const osc = "\x1b]777;";
- if (std.mem.startsWith(u8, rest, osc) or std.mem.startsWith(u8, osc, rest)) {
+ if (std.mem.startsWith(u8, rest, osc) or (rest.len > 1 and std.mem.startsWith(u8, osc, rest))) {
const bel = std.mem.indexOfScalar(u8, rest, 0x07) orelse {
std.mem.copyForwards(u8, f.buf[0..rest.len], rest);
f.fill = rest.len;