aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/libuv_process.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2020-09-10 07:15:32 -0400
committerJames McCoy <jamessan@jamessan.com>2021-01-31 07:54:20 -0500
commit8eec9c7d5b398918609d8edfed3928e873fa646f (patch)
tree113a1e2576385e7a6d1e73769440458d8365ee5a /src/nvim/event/libuv_process.c
parentef7c6b972a1100fc5b173b7273f2c29017557669 (diff)
downloadrneovim-8eec9c7d5b398918609d8edfed3928e873fa646f.tar.gz
rneovim-8eec9c7d5b398918609d8edfed3928e873fa646f.tar.bz2
rneovim-8eec9c7d5b398918609d8edfed3928e873fa646f.zip
Common handling of required/ignored env vars
When starting a pty job, there are certain env vars that we need to either add or remove. Currently, there are two relevant scenarios. * Removing irrelevant env vars on Unix, mostly related to the terminal hosting nvim since they do not apply to a libvterm-hosted terminal. * Adding required env vars for Windows jobs.
Diffstat (limited to 'src/nvim/event/libuv_process.c')
-rw-r--r--src/nvim/event/libuv_process.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c
index 72e45878f6..0b1ecb12e2 100644
--- a/src/nvim/event/libuv_process.c
+++ b/src/nvim/event/libuv_process.c
@@ -83,6 +83,9 @@ int libuv_process_spawn(LibuvProcess *uvproc)
int status;
if ((status = uv_spawn(&proc->loop->uv, &uvproc->uv, &uvproc->uvopts))) {
ELOG("uv_spawn failed: %s", uv_strerror(status));
+ if (uvproc->uvopts.env) {
+ os_free_fullenv(uvproc->uvopts.env);
+ }
return status;
}
@@ -102,6 +105,10 @@ static void close_cb(uv_handle_t *handle)
if (proc->internal_close_cb) {
proc->internal_close_cb(proc);
}
+ LibuvProcess *uvproc = (LibuvProcess *)proc;
+ if (uvproc->uvopts.env) {
+ os_free_fullenv(uvproc->uvopts.env);
+ }
}
static void exit_cb(uv_process_t *handle, int64_t status, int term_signal)