fix: support NVIM_APPNAME in XDG_RUNTIME_DIR socket discovery#49
Merged
Cannon07 merged 1 commit intoCannon07:mainfrom May 6, 2026
Merged
fix: support NVIM_APPNAME in XDG_RUNTIME_DIR socket discovery#49Cannon07 merged 1 commit intoCannon07:mainfrom
Cannon07 merged 1 commit intoCannon07:mainfrom
Conversation
Neovim uses $NVIM_APPNAME (default "nvim") as the socket filename prefix (e.g. "lazynvim.12345.0" instead of "nvim.12345.0"). The hardcoded "nvim.*.0" glob fails to discover sockets when NVIM_APPNAME is set.
Cannon07
approved these changes
May 6, 2026
Owner
Cannon07
left a comment
There was a problem hiding this comment.
LGTM
Thanks for the detailed root-cause analysis and the Neovim source links, it made this trivial to verify.
Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
NVIM_APPNAMEis set (e.g.NVIM_APPNAME=lazynvim), Neovim generatessocket filenames using the custom app name instead of "nvim":
The current glob
nvim.*.0in step 4 fails to discover these sockets.Root Cause
Neovim's
server_address_new()usesget_appname()(which reads$NVIM_APPNAME, defaulting to "nvim") as the socket filename prefix:Reference: https://github.com/neovim/neovim/blob/d9a7b687955bd1af377dba56b87479acd7141f87/src/nvim/msgpack_rpc/server.c#L128-L129 and https://github.com/neovim/neovim/blob/d9a7b687955bd1af377dba56b87479acd7141f87/src/nvim/os/stdpaths.c#L71
Fix
Use
$NVIM_APPNAME(defaulting to "nvim") to construct the glob patterndynamically in the XDG_RUNTIME_DIR scan.