From 5aa1ba3efe0597a5f508b8220961c75c3359ccdb Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Thu, 14 Dec 2023 07:16:21 +0900 Subject: fix(defaults): background detection in tmux (#26557) Wrap the query with passthrough sequence --- runtime/lua/vim/_defaults.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/_defaults.lua') diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index b73681be04..2db82a04a1 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -298,7 +298,11 @@ if tty then end, }) - io.stdout:write('\027]11;?\007') + local query = '\027]11;?\007' + if os.getenv('TMUX') then + query = string.format('\027Ptmux;%s\027\\', query:gsub('\027', '\027\027')) + end + io.stdout:write(query) timer:start(1000, 0, function() -- Delete the autocommand if no response was received -- cgit