| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <20020816145536.12614.qmail@web20001.mail.yahoo.com> |
| Date: | Fri, 16 Aug 2002 07:55:36 -0700 (PDT) |
| From: | Joshua Daniel Franklin <joshuadfranklin AT yahoo DOT com> |
| Subject: | Re: OK, I'm a newbie in CYGWIN... How to do title? |
| To: | cygwin AT cygwin DOT com |
| Cc: | Bruce DOT A DOT Petro AT mail DOT sprint DOT com |
| MIME-Version: | 1.0 |
> 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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |