View previous topic :: View next topic |
Author |
Message |
PhoenixStarEclipse n00b
Joined: 11 May 2017 Posts: 71 Location: Jiangsu/China
|
Posted: Sun Aug 19, 2018 5:09 pm Post subject: [Solved] Where is default $TERM set? |
|
|
In recent linux systems, xterm has 256color support, so xterm-256color doesn't have to appear. However, my $TERM happens to be xterm-256color. I've checked .bashrc and /etc/bashrc, but found nothing about $TERM. I'm just curious where it was initially set.
I don't tend to change /etc/bash/bashrc, since it should only affect interactive shells, while I'd like it to affect everything.
Thanks for your time . _________________ Think twice,code once.
Last edited by PhoenixStarEclipse on Wed Aug 22, 2018 8:27 am; edited 1 time in total |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Aug 20, 2018 8:52 am Post subject: Re: Where is default $TERM set? |
|
|
PhoenixStarEclipse wrote: | In recent linux systems, xterm has 256color support, so xterm-256color doesn't have to appear. However, my $TERM happens to be xterm-256color. I've checked .bashrc and /etc/bashrc, but found nothing about $TERM. I'm just curious where it was initially set. |
PhoenixStarEclipse ... it's set/reported by the terminal, or in the case of console by inittab/agetty. So, if you run screen, or tmux, within your xterm it'll detect the term supports 256 colours and set/report 'screen-256color'. For this reason you shouldn't set TERM in .bashrc or what-have-you.
HTH & best ... khay |
|
Back to top |
|
|
PhoenixStarEclipse n00b
Joined: 11 May 2017 Posts: 71 Location: Jiangsu/China
|
Posted: Mon Aug 20, 2018 9:11 am Post subject: Re: Where is default $TERM set? |
|
|
khayyam wrote: | PhoenixStarEclipse wrote: | In recent linux systems, xterm has 256color support, so xterm-256color doesn't have to appear. However, my $TERM happens to be xterm-256color. I've checked .bashrc and /etc/bashrc, but found nothing about $TERM. I'm just curious where it was initially set. |
PhoenixStarEclipse ... it's set/reported by the terminal, or in the case of console by inittab/agetty. So, if you run screen, or tmux, within your xterm it'll detect the term supports 256 colours and set/report 'screen-256color'. For this reason you shouldn't set TERM in .bashrc or what-have-you.
HTH & best ... khay |
So why did inittab set TERM to xterm-256color, something that doesn't even exist?
And why does simply running "xterm" gives me 256color support? _________________ Think twice,code once. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Mon Aug 20, 2018 10:32 am Post subject: |
|
|
Quote: | xterm-256color, something that doesn't even exist? |
What do you mean by 'it doesn't exist'?
Code: | # ls -la /etc/terminfo/x/xterm-256color
-rw-r--r-- 1 root root 3713 Mar 26 20:26 /etc/terminfo/x/xterm-256color
# qfile /etc/terminfo/x/xterm-256color
sys-libs/ncurses (/etc/terminfo/x/xterm-256color)
|
Last edited by mike155 on Fri Feb 14, 2020 12:13 am; edited 1 time in total |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Aug 20, 2018 1:37 pm Post subject: Re: Where is default $TERM set? |
|
|
PhoenixStarEclipse wrote: | In recent linux systems, xterm has 256color support, so xterm-256color doesn't have to appear. However, my $TERM happens to be xterm-256color. I've checked .bashrc and /etc/bashrc, but found nothing about $TERM. I'm just curious where it was initially set. |
khayyam wrote: | [...] it's set/reported by the terminal, or in the case of console by inittab/agetty. So, if you run screen, or tmux, within your xterm it'll detect the term supports 256 colours and set/report 'screen-256color'. For this reason you shouldn't set TERM in .bashrc or what-have-you. |
PhoenixStarEclipse wrote: | So why did inittab set TERM to xterm-256color, something that doesn't even exist? |
PhoenixStarEclipse ... read carefully, the statement about "inittab" was prefaced with "in the case of console", and as I said, for xterm, urxvt, st, etc, TERM would be set by the terminal itself.
PhoenixStarEclipse wrote: | And why does simply running "xterm" gives me 256color support? |
Because x11-terms/xterm supports 256 colours and so is distinct (terminfo wise) from the original xterm.
best ... khay |
|
Back to top |
|
|
reavertm Developer
Joined: 05 Feb 2004 Posts: 265 Location: Wrocław
|
Posted: Fri Feb 14, 2020 12:02 am Post subject: |
|
|
Bummer then since at least mc built with ncurses doesn't seem to play nice with mouse in X11 terminal, when TERM is set to xterm-*color.
See https://midnight-commander.org/ticket/3954 _________________ Maciek |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Fri Feb 14, 2020 1:57 pm Post subject: |
|
|
So just change inittab if you are running OpenRC |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|