From 516edf15069f18bdf7a8da77f1a449d4e83271c6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 1 Dec 2023 19:35:18 -0800 Subject: [PATCH] termio: only change mouse shape if it is changing Fixes #976 --- src/termio/Exec.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 169228c63..aa2dc72cf 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -2135,6 +2135,10 @@ const StreamHandler = struct { self: *StreamHandler, shape: terminal.MouseShape, ) !void { + // Avoid changing the shape it it is already set to avoid excess + // cross-thread messaging. + if (self.terminal.mouse_shape == shape) return; + self.terminal.mouse_shape = shape; _ = self.ev.surface_mailbox.push(.{ .set_mouse_shape = shape,