aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/server_spec.lua
Commit message (Collapse)AuthorAge
* fix(restart): preserve global cwd on :restart #41304Nathan Zeng2026-08-16
| | | | | | | Problem: On :restart, the new Nvim may "inherit" a local dir as its global CWD. Solution: Inherit the global CWD explicitly.
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(path): normalize separators (slashes) #39155tao2026-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Continue separators normalization, and try to keep it at the nvim <-> external boundary, e.g., `fn.xxx`, `api.xxx`, `:xxx` Solution: some key changes - normalize `$HOME-windows` - normalize entry points of changing directory - `nvim_set_current_dir()`, `chdir()` - normalize the named pipe - `--listen` arg, `--server` arg, `:restart` - `serverstart()`, `sockconnect()`, `serverstop()` - make `expand()` respect 'shellslash' again - clean up `did_set_shellslash` - replace `forward_slash` with `TO_SLASH` - remove obsolete `TMP_PATHSEPSTR` - remove `slash_adjust` in `do_autocmd_dirchanged`? - make `fnamemodify()` always return `/` (except when substituting separators via `:s`, `:gs` ?) Note: - these funcs still apply `slash_adjust` on return, as before: `:pwd`, `chdir()`, `exepath()`, `getcwd()` - these funcs alwarys return `/`, unlike before the normalization PRs - `getcompletion()`, `finddir()`, `findfile()` Also - clean up code, comments, formatting and tests - move `TO_SLASH` from `f_chdir` to `changedir_func` - move `TO_SLASH` from `f_bufadd` to `buflist_new` Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(socket): --listen silently truncates long paths #40625MAAZIZ Adel Ayoub2026-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: A `--listen` path longer than the system socket path limit (~104 bytes on macOS, 108 on Linux) is silently truncated by `uv_pipe_bind()`. Nvim either serves a socket at a different path than `v:servername` reports, or fails with an error that blames the full untruncated path (confusing): nvim: Failed to --listen: address already in use: "<full path>" Steps to reproduce: $ nvim --listen /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide --embed -p nvim: Failed to --listen: address already in use: "/var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide" $ ls /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide "/var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide": No such file or directory (os error 2) $ ls -l /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/ srwxr-xr-x@ - rpatterson 31 Mar 10:24 -Users-rpatterson-Projects-src-github.com-neovid Solution: Bind with `uv_pipe_bind2()` and `UV_PIPE_NO_TRUNCATE` (libuv 1.46+), so a too-long path fails up front with the actual reason: nvim: Failed to --listen: invalid argument: "<full path>"
* feat(:restart)!: ":restart" (no bang) saves/restores session #40321Nathan Zeng2026-06-29
| | | | | | | | | | | Problem: `:restart` does not preserve window layout, etc. Solution: - Change `:restart` to save/restore a session automatically. - Introduce "bang" variant `:restart!` to restart *without* session save/restore. - Introduce `v:startreason`. - `ZR` maps to `:restart!`.
* feat(:restart): v:startreason #40186Nathan Zeng2026-06-18
| | | | | | | | Problem: It's clumsy for scripts to handle a "restart", without custom mappings or global vars. Solution: Introduce `v:startreason`
* feat(server): add v:useractive, use it in serverlist(info=true) #39423Szymon Wilczek2026-05-07
| | | | | | | | | | | | Problem: When showing the :connect menu, it is useful to know which servers are most-recently active. But we don't have a good way to detect that. Solution: - Introduce `v:useractive`. - Include this timestamp in `serverlist({info=true})`. Co-authored-by: Justin M. Keyes <justinkz@gmail.com> Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
* feat(server): serverlist({info=true}) gets detailed info #39392Szymon Wilczek2026-05-06
| | | | | | | | | | | | | | | | | Problem: UI tools and orchestration engines need more context than just raw socket addresses from serverlist(). Without knowing if a server belongs to the current instance or knowing its PID, UIs cannot display meaningful options to users. Solution: - Added the `info=v:true` option to `serverlist()`. - When `info` is requested, it implies `peer=true` and returns a list of dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and `own`. - Uses an RPC request to `getpid()` across the socket to fetch the peer's actual process ID. Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
* test: include test path in summary (#39141)zeertzjq2026-04-17
| | | Ref: https://github.com/neovim/neovim/pull/38486#discussion_r3088483987
* fix(:restart): only pass --headless when there is no UI (#38580)zeertzjq2026-03-31
| | | | Change --embed so that the first UI can be on non-stdio channel even if neither --headless nor --listen is passed.
* docs: api, messages, lsp, trustJustin M. Keyes2026-03-11
| | | | | gen_vimdoc.lua: In prepare for the upcoming release, comment-out the "Experimental" warning for prerelease features.
* refactor(tests): server_spec #37912Justin M. Keyes2026-02-16
|
* fix(tui): log chdir failure properly #37591zeertzjq2026-01-28
|
* test(core/server_spec): check error in logfile (#37469)zeertzjq2026-01-20
|
* fix(socket): remove stale socket files (#37378)James Fotherby2026-01-20
| | | | | | | | | Problem: Crashed Nvim leaves socket files. Subsequent starts fail with "address already in use". Solution: On bind failure, test socket liveness via connect(). Remove if stale, retry bind(). Fixes #36581
* fix(server): serverlist({peer=true}) does not find peer servers #35506Siddhant Agarwal2025-08-28
|
* fix(messages): 'exrc' / secure messagesJustin M. Keyes2025-07-28
|
* docs: lsp, ui events, dev guidance, osc7Justin M. Keyes2025-07-28
| | | | fix #34981
* feat: serverlist({peer=true}) returns peer addresses #34806Siddhant Agarwal2025-07-27
| | | | | | | Problem: serverlist() only lists servers that were started by the current Nvim. Solution: Look for other Nvim servers in stdpath("run").
* fix(startup): server fails if $NVIM_APPNAME is relative dir #30310Justin M. Keyes2024-09-08
Problem: If $NVIM_APPNAME is a relative dir path, Nvim fails to start its primary/default server, and `v:servername` is empty. Root cause is d34c64e342dfba9248d1055e702d02620a1b31a8, but this wasn't noticed until 96128a5076b7 started reporting the error more loudly. Solution: - `server_address_new`: replace slashes "/" in the appname before using it as a servername. - `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/" directory. That isn't intended to be specific to NVIM_APPNAME; rather, each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance. Nvim "apps" can be identified by the server socket(s) stored in those per-Nvim subdirs. fix #30256