From 800e2b965ca59207c2c2223c6cd056b953e5ab95 Mon Sep 17 00:00:00 2001
From: John Drouhard <john@drouhard.dev>
Date: Tue, 26 Dec 2023 05:28:31 -0600
Subject: [PATCH] instant prompt: fix DCS escape substitution to also work with
 tmux passthrough

---
 internal/p10k.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 3c784625..d49a3b60 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -6629,7 +6629,7 @@ function _p9k_clear_instant_prompt() {
       fi
       print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]
       local unexpected=${${content//$'\e[?'<->'c'}//$'\e['<->' q'}
-      unexpected=${(S)unexpected//$'\eP'*[^$'\e']#($'\e\\')}
+      unexpected=${(S)unexpected//$'\eP'($'\e\\'|*[^$'\e']($'\e\\'))}
       unexpected=${(S)unexpected//$'\e'[^$'\a\e']#($'\a'|$'\e\\')}
       # Visual Studio Code prints this garbage.
       unexpected=${${unexpected//$'\033[1;32mShell integration activated\033[0m\n'}//$'\r'}