Skip to content

diff: Neovim hangs at exit after SIGTERM during :%s in a nested autocmd (split layouts) #600

Open

Description

@ThomasK33

Neovim hangs at exit after SIGTERM arrives during :%s in a nested autocmd, with diffs open in a split layout.

Defect. In the vertical and horizontal layouts, with two openDiff calls waiting: a nested = true autocmd runs :%s on a large buffer (for example 300,000 lines, through nvim_buf_call), and SIGTERM arrives during the :%s. Both calls get DIFF_REJECTED, then Neovim hangs while it removes the diffs. Claude's client sees close code 1006 instead of 1001, and the lock file stays. The unified layout exits normally. Reproduced 4 of 4 times with #572 and 2 of 2 times on the commit before it, on Neovim 0.8.0 and 0.12.3. The cause is not known.

This contradicts the README "Exit answers" bullet, which promises close 1001 and a removed lock file for SIGTERM.

Next step. Bisect the exit path (cleanup_at_exit, server.stop, the split-layout diff close) under that trigger, fix it, and add a case to tests/integration/diff_exit_reject_spec.lua. If the hang is in Neovim itself, add the case to the README's list of exits that do not answer.

Owner: the next change to the diff exit path. Deferred from the README verification run with the maintainer's agreement.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageAwaiting maintainer triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions