diff options
author | James McCoy <jamessan@jamessan.com> | 2021-02-06 09:06:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-06 09:06:34 -0500 |
commit | e455f0ba2dc278e4374098c60afa79e1abd3bd3b (patch) | |
tree | ec721c684c925dac096b5a6885e0cf9015538383 /src/nvim/channel.c | |
parent | f4f6cce952c1233136f243e76d096e3aaa0b1689 (diff) | |
parent | 33f92fe025dc326020fbb953f8c042711016fea8 (diff) | |
download | rneovim-e455f0ba2dc278e4374098c60afa79e1abd3bd3b.tar.gz rneovim-e455f0ba2dc278e4374098c60afa79e1abd3bd3b.tar.bz2 rneovim-e455f0ba2dc278e4374098c60afa79e1abd3bd3b.zip |
Merge pull request #13876 from jamessan/pty-term
fix(pty): Always use $TERM from the job's env dict
Diffstat (limited to 'src/nvim/channel.c')
-rw-r--r-- | src/nvim/channel.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c index 5628ede2e6..09a34ca9fe 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -292,7 +292,6 @@ static void close_cb(Stream *stream, void *data) /// directory if `cwd` is NULL /// @param[in] pty_width Width of the pty, ignored if `pty` is false /// @param[in] pty_height Height of the pty, ignored if `pty` is false -/// @param[in] term_name `$TERM` for the pty /// @param[in] env Nvim's configured environment is used if this is NULL, /// otherwise defines all environment variables /// @param[out] status_out 0 for invalid arguments, > 0 for the channel id, @@ -304,8 +303,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, bool pty, bool rpc, bool overlapped, bool detach, const char *cwd, uint16_t pty_width, uint16_t pty_height, - char *term_name, dict_T *env, - varnumber_T *status_out) + dict_T *env, varnumber_T *status_out) { assert(cwd == NULL || os_isdir_executable(cwd)); @@ -318,7 +316,9 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, if (detach) { EMSG2(_(e_invarg2), "terminal/pty job cannot be detached"); shell_free_argv(argv); - xfree(term_name); + if (env) { + tv_dict_free(env); + } channel_destroy_early(chan); *status_out = 0; return NULL; @@ -330,9 +330,6 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, if (pty_height > 0) { chan->stream.pty.height = pty_height; } - if (term_name) { - chan->stream.pty.term_name = term_name; - } } else { chan->stream.uv = libuv_process_init(&main_loop, chan); } @@ -362,9 +359,6 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, if (proc->env) { tv_dict_free(proc->env); } - if (proc->type == kProcessTypePty) { - xfree(chan->stream.pty.term_name); - } channel_destroy_early(chan); *status_out = proc->status; return NULL; |