From 3f9c42fd67f1e05a8a2ae3ca584910b50de6de16 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 20 Dec 2023 21:40:02 -0800 Subject: [PATCH] core: fast path out of click to move if no semantic prompts --- src/Surface.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Surface.zig b/src/Surface.zig index 9ffd36bcd..5cf6fcd0b 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -2097,6 +2097,11 @@ fn clickMoveCursor(self: *Surface, to: terminal.point.ScreenPoint) !void { // support this feature. It is just too messy. if (t.active_screen != .primary) return; + // This flag is only set if we've seen at least one semantic prompt + // OSC sequence. If we've never seen that sequence, we can't possibly + // move the cursor so we can fast path out of here. + if (!t.flags.shell_redraws_prompt) return; + // Get our path const from = (terminal.point.Viewport{ .x = t.screen.cursor.x,