Patch 8.2.0518

22 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 5, 2020, 3:42:48 PM4/5/20
to vim...@googlegroups.com

Patch 8.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)
Files: src/os_unix.c


*** ../vim-8.2.0517/src/os_unix.c 2020-02-26 16:15:31.072386953 +0100
--- src/os_unix.c 2020-04-05 21:40:16.385461280 +0200
***************
*** 5493,5499 ****
// 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";
set_child_environment(
(long)options->jo_term_rows,
(long)options->jo_term_cols,
--- 5493,5506 ----
// Use 'term' or $TERM if it starts with "xterm", otherwise fall
// back to "xterm".
if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0)
! {
! 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,
*** ../vim-8.2.0517/src/version.c 2020-04-05 21:38:11.637962358 +0200
--- src/version.c 2020-04-05 21:41:27.637174642 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 518,
/**/

--
Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke
Any sufficiently advanced bug is indistinguishable from a feature.
Rich Kulawiec

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Christian Brabandt

unread,
Apr 14, 2020, 4:11:54 AM4/14/20
to vim...@googlegroups.com

On So, 05 Apr 2020, Bram Moolenaar wrote:

>
> Patch 8.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)
> Files: src/os_unix.c

Should we also use xterm-direct if xterm supports RGB coloring? I
believe this is the new terminfo entry for xterm with RGB support.

Best,
Christian
--
Ich habe drei Haustiere, die dieselbe Funktion erfüllen wie ein
Ehemann: einen Hund, der jeden Morgen knurrt, einen Papagei, der den
ganzen Nachmittag lang flucht, und eine Katze, die nachts spät nach
Hause kommt.
-- Marie Corelli

Bram Moolenaar

unread,
Apr 14, 2020, 2:16:35 PM4/14/20
to vim...@googlegroups.com, Christian Brabandt

Christian Brabandt wrote:

> On So, 05 Apr 2020, Bram Moolenaar wrote:
>
> >
> > Patch 8.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)
> > Files: src/os_unix.c
>
> Should we also use xterm-direct if xterm supports RGB coloring? I
> believe this is the new terminfo entry for xterm with RGB support.

That is exactly the problem: If we use xterm-direct on a system that
doesn't have this entry, it will fail completely. I'm not sure if there
is a good (efficient) way to check for a working entry. Might be that
loading it is needed, which might be slow.

Perhaps we should just check if $TERM is set to "xterm-.*" and use that
in the terminal too. But when $TERM is "screen-*" or "iterm-*" we
can't.

--
Why I like vim:
> I like VIM because, when I ask a question in this newsgroup, I get a
> one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-)
Reply all
Reply to author
Forward
0 new messages