RE: How to add a title to xterm

2005-12-07 Thread Soong, SylokeJ
Someone posted a clue on how to make MS Windows Cmd window disappear.
I lost that (rather I deleted lots of emails when my quota exceeded).

If we chose to start cygwin thro a bash cmd window ...
~ How to make that annoying bash window disappear ~

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of fergus
Sent: Wed, December 07, 2005 1:55 AM
To: cygwin-xfree@cygwin.com
Cc: [EMAIL PROTECTED]
Subject: Re: How to add a title to xterm

I do not use startx: for me, it sets up unnecessary or inconvenient
defaults.

1. Start bash

then

2. run XWin -nolisten local -multiwindow  Enter
3. xterm -display localhost:0.0 -title Columbia Enter

works fine for me ...

Fergus

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How to add a title to xterm

2005-12-07 Thread Ehud Karni
On Wed, 7 Dec 2005 06:54:41 -, fergus [EMAIL PROTECTED] wrote:

  How to add a title to xterm?

 I do not use startx: for me, it sets up unnecessary or inconvenient
 defaults.

You can always set the xterm title by sending it the string: Esc ] 0 ;
your title ^G . You can do it from the xterm application (writing to
/dev/tty or stdout if its connected, or externally, by writing to
/dev/ttyn [Cygwin] or /dev/pts/n [Linux]).

Bellow is a small script that update the title if it is run on an
interactive xterm (the 2nd is a tty emulator written here).

Ehud


#! /bin/sh -e
# this script sets the TTY title to 1st argument
# --

if [ -t 1 ] ; then # do only if stdout is terminal
TTL=`echo $1 | sed -e s/ [ ]*/ /g` # any length of spaces to 1 space
case $TERM in
xter* ) echo \033]0;$TTL\a\c # write it to xterm window title
;;
npc* )  DTTL=`echo $TTL\c | od -An -tu1 -v | tr \012   | sed -e 
s/ [ ]*/;/g`
echo \033[=/${DTTL:1:999};253;t\c# For Mivtach Simon TTY
;;
esac
fi

## set_tty_title ##


--
 Ehud Karni   Tel: +972-3-7966-561  /\
 Mivtach - Simon  Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How to add a title to xterm

2005-12-07 Thread Robert Body
Here is a script that works in bash or ksh for setting the title based on 
your current path, by setting up $PS1. I have also seen similar thing done 
by aliasing cd command


I use bash mostly, but for ksh there is need for Perl in my script below to 
accomplish the passing of ESC characters to ksh. I could not figure out how 
to do it with awk

-Robert

case `echo _$0 | /usr/bin/tr '[:upper:]' '[:lower:]' | sed -e 's/^_//'` 
in

#
bash | -bash | */bash )
#
echo ...running bash
   HOSTNAME=`hostname`; export HOSTNAME # Set a HOSTNAME variable
#
# 29=white,30=black,31=red,32=green,33=yellow, 34=blue,35=magenta,36=cyan
#
   # Set a default prompt of: [EMAIL PROTECTED] and current_directory
#PS1='\[\e]0;[EMAIL PROTECTED] \[\e[33m\]\w\[\e[0m\]\n\$ '
#PS1='\[\e]0;$HOSTNAME: $PWD\a\]\[\e[36m\]$PWD\[\e[0m\] '# (in 
title) HOST-$PWD ... $PATH

   PS1='\[\e]0;$ME: $PWD\a\]$PWD '# (in title) HOST-$PWD ... $PATH
;;
#
ksh* | -ksh* | */ksh* )
#
echo ...running ksh
   typeset -l HOSTNAME   # Set a HOSTNAME variable

   PS1=$(perl -e 'printf\033]0;$ARGV[0]: \$PWD\007\033[29m\$PWD\033[0m\ 
' $ME)

;;
esac




From: Ehud Karni [EMAIL PROTECTED]
Reply-To: cygwin-xfree@cygwin.com
To: [EMAIL PROTECTED]
CC: cygwin-xfree@cygwin.com
Subject: Re: How to add a title to xterm
Date: Wed, 7 Dec 2005 18:43:29 +0200

On Wed, 7 Dec 2005 06:54:41 -, fergus [EMAIL PROTECTED] 
wrote:


  How to add a title to xterm?

 I do not use startx: for me, it sets up unnecessary or inconvenient
 defaults.

You can always set the xterm title by sending it the string: Esc ] 0 ;
your title ^G . You can do it from the xterm application (writing to
/dev/tty or stdout if its connected, or externally, by writing to
/dev/ttyn [Cygwin] or /dev/pts/n [Linux]).

Bellow is a small script that update the title if it is run on an
interactive xterm (the 2nd is a tty emulator written here).

Ehud


#! /bin/sh -e
# this script sets the TTY title to 1st argument
# --

if [ -t 1 ] ; then # do only if stdout is 
terminal
TTL=`echo $1 | sed -e s/ [ ]*/ /g` # any length of spaces to 1 
space

case $TERM in
xter* ) echo \033]0;$TTL\a\c # write it to xterm window 
title

;;
npc* )  DTTL=`echo $TTL\c | od -An -tu1 -v | tr \012   | sed 
-e s/ [ ]*/;/g`
echo \033[=/${DTTL:1:999};253;t\c# For Mivtach Simon 
TTY

;;
esac
fi

## set_tty_title ##


--
 Ehud Karni   Tel: +972-3-7966-561  /\
 Mivtach - Simon  Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/





--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How to add a title to xterm

2005-12-06 Thread fergus
 How to add a title to xterm?

 I start cygwinx by startx.
 The following commands does not work:
 xterm -T columbia 
 xterm -title columbia 
 xterm -title columbia 

I do not use startx: for me, it sets up unnecessary or inconvenient
defaults.

1. Start bash

then

2. run XWin -nolisten local -multiwindow  Enter
3. xterm -display localhost:0.0 -title Columbia Enter

works fine for me ...

Fergus




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How to add a title to xterm

2005-12-05 Thread Brian Dessent
PoWah Wong wrote:

 How to add a title to xterm?
 
 I start cygwinx by startx.
 The following commands does not work:
 xterm -T columbia 
 xterm -title columbia 
 xterm -title columbia 

The default cygwin prompt contains escape characters that set the window
title to contain the CWD.  Thus anything you set the title to will be
overwritten the next time a prompt is printed.  You need to either
modify the prompt so that it doesn't try to set the window title, or
change the prompt to include the desired window title.

Brian

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How to add a title to xterm

2005-12-05 Thread PoWah Wong
e.g. I do something like this:
PS1=[EMAIL PROTECTED] \w\n\$ 

--

PoWah Wong wrote:

 How to add a title to xterm?
 
 I start cygwinx by startx.
 The following commands does not work:
 xterm -T columbia 
 xterm -title columbia 
 xterm -title columbia 

The default cygwin prompt contains escape characters
that set the window
title to contain the CWD.  Thus anything you set the
title to will be
overwritten the next time a prompt is printed.  You
need to either
modify the prompt so that it doesn't try to set the
window title, or
change the prompt to include the desired window title.

Brian






__ 
Find your next car at http://autos.yahoo.ca

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/