Problem: Shell programs aren't able to detect nvim exit.
Solution: Avoid running shell-commands unnecessarily on exit.
_Tested with opts = { autoload = true, follow_cwd = false }_
Programs that spawn nvim in-order to edit a file are unable to detect nvim exit cleanly because of a race-condition that happens in VimLeavePre and get_current() which runs shell commands during exit even when autosave is off.
To reproduce, use nvim nightly, run persisted.nvim with:
opts.should_autosave = function()
-- Do not autosave if git commit/rebase session.
return vim.env.GIT_EXEC_PATH == nil
end
And run EDITOR=nvim git commit from shell; git will fail waiting for nvim to exit cleanly.
Problem: Shell programs aren't able to detect nvim exit.
Solution: Avoid running shell-commands unnecessarily on exit. _Tested with
opts = { autoload = true, follow_cwd = false }
_Programs that spawn nvim in-order to edit a file are unable to detect nvim exit cleanly because of a race-condition that happens in
VimLeavePre
andget_current()
which runs shell commands during exit even whenautosave
is off.To reproduce, use nvim nightly, run persisted.nvim with:
And run
EDITOR=nvim git commit
from shell; git will fail waiting for nvim to exit cleanly.