mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.0518: a terminal falls back to setting $TERM to "xterm"
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)
This commit is contained in:
@@ -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
|
// Use 'term' or $TERM if it starts with "xterm", otherwise fall
|
||||||
// back to "xterm".
|
// back to "xterm".
|
||||||
if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0)
|
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(
|
set_child_environment(
|
||||||
(long)options->jo_term_rows,
|
(long)options->jo_term_rows,
|
||||||
(long)options->jo_term_cols,
|
(long)options->jo_term_cols,
|
||||||
|
@@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
518,
|
||||||
/**/
|
/**/
|
||||||
517,
|
517,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user