Re: Label the Terminal window



* Firedog@icekitten.com (firedog@icekitten.com) wrote:
> How do you label a terminal windows ? I have 6 or 7 open at all times and
> get confused which one is running what sometimes.

As well as Telsa's suggestions, you have on further option. This is
what I use to keep my terminal titles up to date, all the time.

Stick these lines in your ~/.bashrc (assuming you use bash =))

if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "xterms" ];
then
   if [ "$DISPLAY" = ":0.0" ];
   then
      PROMPT_COMMAND='echo -ne "\033]0;<${USER}>:  ${PWD}\007"'
   else
      PROMPT_COMMAND='echo -ne "\033]0;<${USER}@${HOSTNAME}>:  ${PWD}\007"'
   fi
   export PROMPT_COMMAND
fi

If you didn't know, PROMPT_COMMAND is an environment variable who's
contents will be run every time a prompt is displayed, so the term
will show where you are, and always be up to date. My version above is
supposed to only show the @hostname part if you aren't logged in to a
local system, but maybe this could be done better.

Of course, you could add anything you like in there, so long as its
quick to run (it'll be run on every prompt). So adding "date: `date`"
somewhere within the quotes would show the current date too.

Have a look at http://www.tomgilbert.freeserve.co.uk/bashprompts.html
for a nice prompt to go with it ;)

Tom.
-- 
            .-------------------------------------------------------.
    .^.     | Tom Gilbert, England | tom@tomgilbert.freeserve.co.uk |
    /V\     |----------------------| www.tomgilbert.freeserve.co.uk |
   // \\    | Sites I recommend:   `--------------------------------|
  /(   )\   | www.freshmeat.net www.enlightenment.org slashdot.org  |
   ^^-^^    `-------------------------------------------------------'



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