mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem:
- Since c57f6b28d7
#8519, sockets are created in ~/.local/… but XDG
spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which
implies that XDG_STATE_DIR is potentially non-local.
- Not easy to inspect Nvim-created temp files (for debugging etc).
Solution:
- Store sockets in stdpath('run') ($XDG_RUNTIME_DIR).
- Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims.
- Make ok() actually useful.
- Introduce assert_nolog().
closes #3517
closes #17093
This commit is contained in:
@@ -89,7 +89,7 @@ void server_teardown(void)
|
||||
///
|
||||
/// Named pipe format:
|
||||
/// - Windows: "\\.\pipe\<name>.<pid>.<counter>"
|
||||
/// - Other: "~/.local/state/nvim/<name>.<pid>.<counter>"
|
||||
/// - Other: "/tmp/nvim.user/xxx/<name>.<pid>.<counter>"
|
||||
char *server_address_new(const char *name)
|
||||
{
|
||||
static uint32_t count = 0;
|
||||
@@ -98,7 +98,7 @@ char *server_address_new(const char *name)
|
||||
int r = snprintf(fmt, sizeof(fmt), "\\\\.\\pipe\\%s.%" PRIu64 ".%" PRIu32,
|
||||
name ? name : "nvim", os_get_pid(), count++);
|
||||
#else
|
||||
char *dir = get_xdg_home(kXDGStateHome);
|
||||
char *dir = stdpaths_get_xdg_var(kXDGRuntimeDir);
|
||||
int r = snprintf(fmt, sizeof(fmt), "%s/%s.%" PRIu64 ".%" PRIu32,
|
||||
dir, name ? name : "nvim", os_get_pid(), count++);
|
||||
xfree(dir);
|
||||
|
Reference in New Issue
Block a user