zplug: Ctrl+z (suspend) does not work after zplug loaded
Problem Summary
Ctrl+z (suspend) does not work after zplug loaded.
System Information
uname -a
Linux chajka 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
- zsh version
zsh 5.0.2 (x86_64-redhat-linux-gnu)
- zplug version/commit
2.3.4
Minimal zshrc
source ~/.zplug/init.zsh
zplug load --verbose
If I comment out zplug load, Ctrl+Z becomes working well.
Steps to Reproduce
- Start zsh.
- Launch vim.
- Try to press Ctrl+Z to suspend vim, but it does not suspend. This also happen in emacs.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 32 (8 by maintainers)
@b4b4r07 I have had this issue for way way too long and could not solve it. But then I found a “loophole” which rendered virtually any potential fix useless:
The polling code only checks if the lock file exists. That means that if this file is added manually then zplug will disable the
monitoroption automatically and indefinitely.Also the
clearcommand doesn’t remove the lock file. This means that it is not impossible that an old lock file that was not cleaned up (maybe due to a zplug job that might have been interrupted).I fixed the problem by manually removing the lock file. After that, everything worked normally out of the box (without the
set -o monitorfix or anything similar).I haven’t looked around but a first step to resolve this issue once and for all would be to check the validity of the lock file. Or check if there are any zplug jobs still running. And if the lock file contains a pid, check if that pid exist and points to a zplug job. But I’m pretty sure testing for the existence of the file is not enough.
Removing the lock file $_zplug_lock fixes the issue for subsequent restarts of zsh.
Removing the lock file works. The filename is
~/.zplug/log/job.lock.Hello,
I can confirm @paulhybryant findings. Adding
setopt monitorafterzplug loadfixes the problem and it does not breakzplug status.~/.zshrc:
Versions (Debian unstable):
I can’t reproduce it after a
zplug clear, guess that was some old cache causing this. Sorry for the noise. And thanks for the quick response @b4b4r07.