delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/02/22:31:11

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3AF0B4AA.835DDA0@acedsl.com>
Date: Wed, 02 May 2001 21:30:18 -0400
From: "Matthew O. Persico" <persicom AT acedsl DOT com>
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Who controls window title??
References: <200105010849 DOT tetmp6 DOT mc8 DOT 37tiucr AT kestrel> <3AEEE399 DOT 8070009 AT earthlink DOT net>

Jonathon Merz wrote:
> 
> 
> There is a small GPL'd utility that I think will do what you want.  It's
> called xttitle, you can get it at:
> 
>         http://www.jarvis.com/xttitle/

Why futz with an executable? Put the following in a startup file. If
it's too feature-full for you, cut out all the +|-|= jazz.

I am assuming we are talking about a xterm window. I'd like to know how
to modify a non-xterm title bar. Any ideas?

# add to (+), delete from (-), print (.), or set ([=]) window title
# arguments are eval'd before printing
# title text string exported in TITLE_TEXT

function title # [+ | - | =] title ...
{
        local x t="$TITLE_TEXT"

        case $1 in
        +)      shift
                case $# in
                0)      ;;
                *)      for x
                        do      case " $t " in
                                *" $x "*)       ;;
                                "  ")           t=$x ;;
                                *)              t="$t $x" ;;
                                esac
                        done
                        case $t in
                        $TITLE_TEXT)    return 1 ;;
                        esac
                        ;;
                esac
                ;;

        -)      shift
                case $# in
                0)      ;;
                *)      for x
                        do      case " $t " in
                                *" $x "*)       t="${t%?(
)$x*}${t##*$x?( )}" ;;
                                esac
                        done
                        case $t in
                        $TITLE_TEXT)    return 1 ;;
                        esac
                        ;;
                esac
                ;;
        .)      echo -r -- "$TITLE_TEXT"
                return 0
                ;;
        *)      t="$*"
                ;;
        esac
        export TITLE_TEXT="$t"
        eval x=\"$t\"
        case $TERM in
        630*)   echo -n "^[[?${#x};0v$x" ;;
        vt100|xterm*)   echo -n "^[]0;$x^G" ;;
        *)      return 1 ;;
        esac
        return 0
}


>   The "official" build (ie Makefile) didn't run properly on Cygwin when I
> tried it last, but there is only one source file, and it compiled fine with
> gcc not using make, so you shouldn't have any trouble.
> 
> I have the following function in my .bashrc:
> 
> function cd_xttitle {
>     \cd $1
>     xttitle.exe $(echo $HOSTNAME:$PWD)
> }
> 
> and I have my cd aliased as:
> 
> alias cd='cd_xttitle'
> 
> This will keep the window title to what you are asking for I believe.
> 
> Hope that helps,
> 
> Jon
> 
> --
> 
> -------------------------------------
>   If you had a million Shakespeares,
>   could they write like a monkey?
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple


-- 
Matthew O. Persico
    
http://www.acecape.com/dsl
AceDSL:The best ADSL in Verizon area

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019