Neovim froze in Insert mode waiting for tmux list-panes

On a remote machine, Neovim stopped responding when I entered Insert mode inside tmux. I was running Neovim 0.10.2 with LazyVim, nvim-cmp, and cmp-tmux, which suggests words from other tmux panes.
The frozen editor was waiting for tmux list-panes. Removing just cmp-tmux fixed the freeze. The other completion sources stayed enabled.
Ask the frozen process what it is waiting for
Instead of restarting the frozen editor, I inspected it from a second shell on the same machine:
|
|
The relevant lines from the process listing (columns trimmed):
|
|

Rendered excerpt of the process listing. The PPID on the boxed line matches the PID of the blocked Neovim process.
The parent-child relationship was the first clue. The file descriptor listing made the connection: the tmux client’s stdout and one of Neovim’s read descriptors pointed to the same pipe. Neovim was stuck reading from it.
Why a completion source could freeze the editor
The cmp-tmux source calls get_panes() to find panes to scan. I had all_panes = true, so it added -a to tmux list-panes -F '#{pane_id}'. The blocking part is in lua/cmp_tmux/tmux.lua, before the plugin starts any asynchronous jobs to capture pane contents:
|
|
read('*all') waits for end-of-file. If the tmux client doesn’t finish, that read holds up Neovim’s main loop. Completion made the whole editor look frozen, not just the popup menu.
A fresh request from another shell did return later:
|
|
That check showed tmux could answer a new request. It didn’t explain why the original client stalled, and I didn’t need to solve that to remove the blocking call from my editor.
Workaround: skip tmux completion for one launch
|
|
cmp-tmux checks for the TMUX environment variable. Unsetting it for this launch makes the plugin skip pane completion without changing the parent shell or any config files. This won’t unfreeze an existing editor, and other tmux-aware features in the new process may behave differently too.
Fix: remove only the tmux source
My setup builds on the nvim-cmp configuration. On the affected machine I backed up the active spec before editing it:
|
|
In ~/.config/nvim/lua/plugins/nvim-cmp.lua, I removed two things:
'andersevenrud/cmp-tmux',from thenvim-cmpdependencies.- The
name = 'tmux'source and its options fromcmp.config.sources(...). It was the only source in the last group, so I removed that group and the comma that had separated it from the previous one.
Then I opened a fresh Neovim session. I didn’t need to restart tmux, change terminal settings, or turn off nvim-cmp.
Verify that Insert mode and completion still work
To check the active source list in a fresh editor, first load the plugin, then print its sources:
|
|
|
|
The new config passed a Lua syntax check. With TMUX set and nvim-cmp loaded, a fresh headless Neovim processed i followed by test text and reported Mode: i; buffer: insertmodetest. Reopening Neovim in the normal terminal session fixed the original symptom too.
The only feature I lost was suggestions from other tmux panes. If the whole editor stops responding during completion, check its child processes before disabling every plugin: a single synchronous call can make an otherwise healthy editor look dead.
相关内容
- Profiling Neovim on big logs: a growing 87 MB log froze the UI 11 s out of every 15
- Profiling Neovim startup: lazy-loaded plugins that weren't lazy
- Nested tmux over SSH: automatically route Ctrl-k to the remote
- Lining up the Claude Code status line with my powerlevel10k prompt: padding -2 and a 5-second refresh
- Fixing duplicated tmux status bars and missing icons in Termius on iPhone
支付宝
微信

william