summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/Core.zig b/core/Core.zig
index b8ca9439..2036fd77 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -898,11 +898,16 @@ fn reportFocus(p: *Pardes) void {
break :blk .{ .id = v.active, .serial = pane.serial };
};
if (std.meta.eql(want, v.focus_told)) return;
+ defer v.focus_told = want;
+ // A client's own step records what it told and writes nothing: the
+ // session's step makes the write, off the tape on both sides
+ // (tape.hostCall's pty_write), so the switch shows at once and the
+ // program hears of it a round trip later.
+ if (tape.speculating() and tape.screenState()) return;
if (v.focus_told) |old| if (p.panes[old.id]) |pane| {
if (pane.serial == old.serial and pardes.Term.modes(pane.terminal).focus) p.emitWrite(old.id, "\x1b[O");
};
if (want) |new| if (pardes.Term.modes(p.panes[new.id].?.terminal).focus) p.emitWrite(new.id, "\x1b[I");
- v.focus_told = want;
}
pub fn emitWrite(p: *Pardes, id: usize, bytes: []const u8) void {