Skip to content

feat(findNvim)!: rename paths:string[] => cmds:string[][] - #432

Merged
justinmk merged 2 commits into
masterfrom
findnvim
Sep 11, 2026
Merged

justinmk merged 2 commits into
masterfrom
findnvim

Conversation

@justinmk

@justinmk justinmk commented Oct 21, 2024 •

Copy link
Copy Markdown
Member

Problem

Consumers like vscode-neovim/vscode-neovim#2287 can't send a full command which represents "nvim". It can only send a location (arg0) or directory.

But such consumers want to invoke Nvim in WSL, which requires extra preamble before the nvim.exe part:

https://github.com/vscode-neovim/vscode-neovim/blob/c3e8387a9e9f923ec39c28af6cb8985ca431e438/src/main_controller.ts#L181-L186

if (config.useWsl) {
    args.push("C:\\Windows\\system32\\wsl.exe");
    if (config.wslDistribution.length) {
        args.push("-d", config.wslDistribution);
    }
}

Solution

node-client doesn't need to know about WSL, it just needs to run what the consumer gives it. Currently the consumer can only send arg0, but we can fix that by allowing consumers to send [arg0, arg1, ...].

  • Change findNvim to accept cmds: string[][], so that consumers can pass a command like:
    findNvim(..., {
     cmds: [
       ['C:\\Windows\\system32\\wsl.exe', '-d', ..., 'nvim'],
     ],
    })
  • Drop the paths:string[] option. It's redundant with cmds.

fix #430
fix #426

The legacy `findNvim(…, { paths:… })` is still supported for
back-compat.
@justinmk
justinmk merged commit 8442fe0 into master Sep 11, 2026
8 checks passed
@justinmk
justinmk deleted the findnvim branch September 11, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

findNvim: support finding nvim in Windows WSL unreliable test: "findNvim searches in additional custom dirs"

1 participant