fix(tui): v:argv does not report the original argv[0] #24015

Problem:
Since TUI was moved to another process 2448816956
v:argv and v:progname don't report the original argv[0].
    ["/usr/bin/nvim", "--embed", ...]

Solution:
Use argv[0] instead of VV_PROGPATH in ui_client_start_server().
Fix #23953
This commit is contained in:
t0muxx 2023-06-14 09:39:14 +00:00 committed by GitHub
parent bc67bbe446
commit 0ce065a332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ uint64_t ui_client_start_server(int argc, char **argv)
varnumber_T exit_status;
char **args = xmalloc(((size_t)(2 + argc)) * sizeof(char *));
int args_idx = 0;
args[args_idx++] = xstrdup(get_vim_var_str(VV_PROGPATH));
args[args_idx++] = xstrdup(argv[0]);
args[args_idx++] = xstrdup("--embed");
for (int i = 1; i < argc; i++) {
args[args_idx++] = xstrdup(argv[i]);