Mercurial > vim
comparison src/os_unix.c @ 19924:851b9af01aad v8.2.0518
patch 8.2.0518: a terminal falls back to setting $TERM to "xterm"
Commit: https://github.com/vim/vim/commit/5ba8d3578c835edcfb7e3b132e623c12e62f250b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 5 21:42:12 2020 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Apr 2020 21:45:26 +0200 |
parents | 22f0dda71638 |
children | bdb712c7ecf4 |
comparison
equal
deleted
inserted
replaced
19923:cc6243727bd6 | 19924:851b9af01aad |
---|---|
5491 term = getenv("TERM"); | 5491 term = getenv("TERM"); |
5492 #endif | 5492 #endif |
5493 // Use 'term' or $TERM if it starts with "xterm", otherwise fall | 5493 // Use 'term' or $TERM if it starts with "xterm", otherwise fall |
5494 // back to "xterm". | 5494 // back to "xterm". |
5495 if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0) | 5495 if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0) |
5496 term = "xterm"; | 5496 { |
5497 if (t_colors > 16) | |
5498 term = "xterm-color"; | |
5499 if (t_colors >= 256) | |
5500 term = "xterm-256color"; | |
5501 else | |
5502 term = "xterm"; | |
5503 } | |
5497 set_child_environment( | 5504 set_child_environment( |
5498 (long)options->jo_term_rows, | 5505 (long)options->jo_term_rows, |
5499 (long)options->jo_term_cols, | 5506 (long)options->jo_term_cols, |
5500 term, | 5507 term, |
5501 is_terminal); | 5508 is_terminal); |