[vim/vim] Environment variable $TERM is not passed correctly to a job (#2776)

114 views
Skip to first unread message

Bohr Shaw

unread,
Apr 4, 2018, 12:27:03 AM4/4/18
to vim/vim, Subscribed

:help terminal-unix says $TERM is passed to a running job.
But after :let $TERM = 'xterm-256color' | term bash --norc, $TERM in bash is still equal to xterm.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Bram Moolenaar

unread,
Apr 4, 2018, 3:22:24 PM4/4/18
to vim/vim, Subscribed

Bohr Shaw wrote:

> `:help terminal-unix` says `$TERM` is passed to a running job.
> But after `:let $TERM = 'xterm-256color' | term bash --norc`, `$TERM` in `bash` is still equal to `xterm`.

The value of 'term' is passed in $TERM. It's sort-of mentioned in the help,
I'll make it clearer.

--
From "know your smileys":
:-* A big kiss!

/// 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 ///

Bohr Shaw

unread,
Apr 4, 2018, 8:57:00 PM4/4/18
to vim/vim, Subscribed

I got "term can't be changed in gvim".

Tony Mechelynck

unread,
Apr 4, 2018, 10:01:40 PM4/4/18
to vim/vim, Subscribed

Indeed, 'term' in the Vim GUI is set to "builtin_gui" and cannot be changed. If you want to change which 'term' value is passed to the terminal, I think you can do it in your vimrc (which is sourced before starting the GUI) or even by setting $TERM in the shell before starting gvim.

Best regards,
Tony.

Bohr Shaw

unread,
Apr 5, 2018, 1:24:52 AM4/5/18
to vim/vim, Subscribed

In gvim on Linux, the 'term' value passed to the terminal is not affected by the value of $TERM whenever it's set.

Bram Moolenaar

unread,
Apr 5, 2018, 4:48:13 AM4/5/18
to vim/vim, Subscribed

> In gvim on Linux, the 'term' value passed to the terminal is not affected by the value of $TERM whenever it's set.

Ah, yes, in the GUI this doesn't make sense.

The reason I decided to pass 'term' in $TERM was mainly to make it easy
to run Vim inside a terminal window. I suppose in the GUI we should
pass xterm-256color, since that's closest to what works in libvterm.

Is there a reason you would want to set $TERM to something else?

--
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.


/// 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 ///

Bohr Shaw

unread,
Apr 5, 2018, 5:06:18 AM4/5/18
to vim/vim, Subscribed

Is there a reason you would want to set $TERM to something else?

No,xterm-256color is enough.

Bram Moolenaar

unread,
Apr 5, 2018, 4:16:06 PM4/5/18
to vim/vim, Subscribed

Closed #2776 via 9a993e3.

Egbert

unread,
Apr 9, 2020, 6:06:59 PM4/9/20
to vim/vim, Subscribed

I poked xterm-direct, for unlimited color. Alas, not yet.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Reply all
Reply to author
Forward
0 new messages