This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OK, I'm a newbie in CYGWIN... How to do title?


> I promise, I checked the archives and docs and don't see anything on
> this...
>
> Can someone share how I perform the equivalent of the NT 'title'
> command on a CYGWIN window??   I've got 4-6 CYGWIN windows open - each
> tailing a certain log file.  Only problem is its not obvious which
> window is which log file!  What I need is to do something like:
> $title "Logfile1"
> tail -f logfile1.log

While this is not Cygwin-specific, I got curious how linux does this since
I've noticed the TERM setting effects whether my title is set in rxvt. From
my RH-7.2 box's /etc/bashrc (spacing will probably be screwed up):
-----------------snip-----------------
case $TERM in
    xterm*)
            if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
                    PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
            else
            PROMPT_COMMAND='echo -ne
"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
            fi                                                                 
                                           ;;
    *)
            [ -e /etc/sysconfig/bash-prompt-default ] &&
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
        ;;
esac

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

-----------------snip-----------------
and, from "man bash":

PROMPT_COMMAND
   If set, the value is executed as a command prior to
   issuing each primary prompt.

My personal favorite thing to do is put the current time:

export PS1=$PS1"\[\e]0;[\t]\a\]"

Note that this will screw you up if you use the full-screen console on Linux
unless you protect the TERM=linux. As for Cygwin, though, it works in both the
cmd-console and rxvt.

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]