aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/lua/vim/termcap.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/lua/vim/termcap.lua b/runtime/lua/vim/termcap.lua
index b88d9ac9ba..e48657b3c2 100644
--- a/runtime/lua/vim/termcap.lua
+++ b/runtime/lua/vim/termcap.lua
@@ -39,6 +39,12 @@ function M.query(caps, cb)
local k, rest = resp:match('^\027P1%+r(%x+)(.*)$')
if k and rest then
local cap = vim.text.hexdecode(k)
+ if not pending[cap] then
+ -- Received a response for a capability we didn't request. This can happen if there are
+ -- multiple concurrent XTGETTCAP requests
+ return
+ end
+
local seq ---@type string?
if rest:match('^=%x+$') then
seq = vim.text