help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Where does $TERM come from?


From: Greg Wooledge
Subject: Re: [Help-bash] Where does $TERM come from?
Date: Thu, 11 Jun 2015 10:50:56 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Jun 11, 2015 at 09:40:18AM -0500, Peng Yu wrote:
> Hi, I see the $TERM variable is available in bash, but it is not in
> the manual. Does anybody know where it comes from and where it is
> documented? Thanks.

Bash inherits it from its parent process, which is typically one of:

 * an X terminal emulator like xterm
 * a terminal multiplexer like screen or tmux
 * the getty/login team on a serial connection or operating system console
 * sshd, which in turn gets TERM from the ssh remote client

In the absence of TERM, or even sometimes despite its presence, some
operating system standard dot-files (~/.profile or /etc/profile)
will still run a program to query the terminal type interactively.
You probably won't see this much on Linux, but it's rampant on commercial
unices.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]