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: Andrew Miller
Subject: Re: [Help-bash] Where does $TERM come from?
Date: Sun, 21 Jun 2015 03:50:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Greg Wooledge <address@hidden> writes:

> 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

Does bash save the ancestral PID somewhere?

To explain what I mean, this works:

$ readlink /proc/$PPID/exe
/usr/bin/tmux
$ echo $TERM
screen

But this doesn't:

$ sudo bash
# readlink /proc/$PPID/exe
/usr/bin/sudo
# echo $TERM
screen




reply via email to

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