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: Mon, 22 Jun 2015 08:19:22 -0400
User-agent: Mutt/1.4.2.3i

On Sun, Jun 21, 2015 at 03:50:36AM +0000, Andrew Miller wrote:
> 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

They both appear to give the same output to me.  They both give the
value of TERM which is screen.  What does you mean by "doesn't work"?
What more do you want?

If you want to know whether you are inside screen(1) or inside tmux(1)
then you can configure one of them to set a different TERM variable,
or use some other screen- or tmux-specific feature to determine which
one you're inside.  For example, a quick look at my screen(1) man page
says there is an environment variable named STY, and in tmux(1) I can
see TMUX_PANE.  Maybe one of those is what you want?



reply via email to

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