diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-05 21:42:12 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-05 21:42:12 +0200 |
commit | 5ba8d3578c835edcfb7e3b132e623c12e62f250b (patch) | |
tree | c07992425f1ed5f6be0fa371270b712da5a5caef /src/os_unix.c | |
parent | 4c68375057c25e99656bc996d3fa5c6b0b6a7e6a (diff) | |
download | vim-git-5ba8d3578c835edcfb7e3b132e623c12e62f250b.tar.gz |
patch 8.2.0518: a terminal falls back to setting $TERM to "xterm"v8.2.0518
Problem: A terminal falls back to setting $TERM to "xterm".
Solution: Use "xterm-color" if more than 16 colors are supported and
"xterm-256color" if at least 256 colors are supported.
(closes #5887)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index c0a4fdbe3..397342c68 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5493,7 +5493,14 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options, int is_terminal) // Use 'term' or $TERM if it starts with "xterm", otherwise fall // back to "xterm". if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0) - term = "xterm"; + { + if (t_colors > 16) + term = "xterm-color"; + if (t_colors >= 256) + term = "xterm-256color"; + else + term = "xterm"; + } set_child_environment( (long)options->jo_term_rows, (long)options->jo_term_cols, |