diff options
author | James McCoy <jamessan@jamessan.com> | 2021-02-03 23:54:32 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2021-02-06 07:12:33 -0500 |
commit | 33f92fe025dc326020fbb953f8c042711016fea8 (patch) | |
tree | ec721c684c925dac096b5a6885e0cf9015538383 /src/nvim/os/pty_process_unix.c | |
parent | f4f6cce952c1233136f243e76d096e3aaa0b1689 (diff) | |
download | rneovim-33f92fe025dc326020fbb953f8c042711016fea8.tar.gz rneovim-33f92fe025dc326020fbb953f8c042711016fea8.tar.bz2 rneovim-33f92fe025dc326020fbb953f8c042711016fea8.zip |
fix(pty): Always use $TERM from the job's env dict
Before #12937, the only way to specify the `$TERM` for a pty job was
through the `TERM` key in the job's opts dict. This was shuttled to the
child process throug a special field on the PtyProcess object and
injected into the environment after forking.
Now that we have a proper way to specify the environment for a job, we
can simply ensure that the env dict has a proper `TERM` set and avoid
the extra shuttling of data around.
This deprecates the use of the `TERM` option, but will still honor it if
present, although at a lower priority than a `TERM` present in the env
dict.
This also fixes #13874 because we're no longer trying to overwrite
`TERM` in the env dict with the special pty `term_name`. Doing so
raises an internal error because of the existing key which, under
certain circumstances, would cause the "hit enter" prompt. However,
since the child process had already forked, there was no way for the
user to acknowledge the prompt and we would just hang there.
Diffstat (limited to 'src/nvim/os/pty_process_unix.c')
-rw-r--r-- | src/nvim/os/pty_process_unix.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index 348a139e79..d794969ab5 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -182,8 +182,6 @@ static void init_child(PtyProcess *ptyproc) char *prog = ptyproc->process.argv[0]; assert(proc->env); - tv_dict_add_str(proc->env, S_LEN("TERM"), - ptyproc->term_name ? ptyproc->term_name : "ansi"); environ = tv_dict_to_env(proc->env); execvp(prog, proc->argv); ELOG("execvp failed: %s: %s", strerror(errno), prog); |