261020.19 · f2e0dd99f7594889ff9894aa56b54e032a87589d
fix(win): pin parent NVIM in spawn env, always quit CLI on attach
Address the second review round on the Windows spawn route.
`fzf.raw_fzf` pins `NVIM` to `vim.v.servername` in the `win_spawn` spec environment. The spec env is also consumed by the TUI mediator (`win_spawn.lua`), where `libuv.uv_spawn` fills missing variables from the process that spawns fzf (`tbl_extend("keep", opts.env, env)`), so without the pin fzf's children (`nvim --server $NVIM` commands, nvim_server previewer, item commands) would receive the mediator's own server address instead of the editor that owns the picker. The in-process CLI route is unchanged (`uv_spawn` already injected the same value there); in the mediator route the pinned key wins over the mediator's own `NVIM` injection.
The CLI server-list action quits after `win_exec` regardless of the launch result, superseding the conditional from 981d47d1. By the time the takeover runs, the action has already closed every channel and terminated every child (fzf included): the picker cannot continue and a surviving CLI process would only hang the console it was supposed to hand over. `win_exec` still reports spawn failures via `utils.warn`.
`child.stop` in the test helpers warns when a child is still alive after `jobstop` before returning, still keeping `child.job` for a later retry. `vim.notify` over `error()`, which would not surface since callers `pcall(child.stop)`; a silent return would hide a stuck child from CI logs.
Review note (verified, no change): `test.screenshot.with_retry` was asked to call `capture()` outside the retry `pcall` - it already does. Argument expressions are evaluated before `pcall` is entered, so `capture()` errors propagate immediately and never consume a retry; only `compare` failures (the intended retry target) are caught.
Tests: `fzf_spec` win_spawn case asserts the pinned `NVIM`. Windows full suite green on nightly (313 cases, 0 fails) and stable (313/0), focused `{win}` group green, emmylua --warnings-as-errors clean.
reading declarations
Changes to tests/fzf_spec.lua. All files
@@ -101,6 +101,9 @@ describe("Testing fzf launcher", function() assert.is.True(#spec.outfile > 0) eq(captured.env.SHELL, "cmd.exe") eq(captured.env.FZF_DEFAULT_COMMAND, "echo foo || break")+ -- `NVIM` is pinned to this instance (the spec env is also consumed by the+ -- TUI mediator's spawns, see `fzf.raw_fzf`)+ eq(captured.env.NVIM, vim.v.servername) end) it("has no cmd.exe/PowerShell length limit for long arguments", function()