Setting a title for xterm - Xwindows

This is a discussion on Setting a title for xterm - Xwindows ; Hi, How do I set the title for xterm terminal ? I tried this : xterm -T "make window" # to set the title to 'make window' but it does not seem to work....

+ Reply to Thread
Results 1 to 3 of 3

Thread: Setting a title for xterm

  1. Setting a title for xterm

    Hi,

    How do I set the title for xterm terminal ?
    I tried this :

    xterm -T "make window" # to set the title to 'make window'

    but it does not seem to work.


  2. Re: Setting a title for xterm

    vidyut.vidyut@gmail.com wrote:

    > xterm -T "make window" # to set the title to 'make window'
    > but it does not seem to work.


    The usual reason is that one's shell initialization scripts set the
    title, overwriting what was set on the command-line.

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

  3. Re: Setting a title for xterm

    Thomas Dickey writes:

    > vidyut.vidyut@gmail.com wrote:
    >
    >> xterm -T "make window" # to set the title to 'make window'
    >> but it does not seem to work.

    >
    > The usual reason is that one's shell initialization scripts set the
    > title, overwriting what was set on the command-line.


    Hence set-xterm-title:

    #!/bin/bash
    device=/dev/tty
    while [ $# -ge 1 ] ; do
    case "$1" in
    -d|--device) device=$2 ; shift ; shift ;;
    *) if [ -z "$title" ] ; then
    title="$1"
    else
    title="$title $1"
    fi
    shift
    ;;
    esac
    done
    echo -n "]2;${title}" >> "$device"
    # The string containts an ESC in first position and a C-g in last.
    # You can enter them on the terminal with C-v ESC and C-v C-g
    # or in emacs with C-q ESC and C-q C-g


    --
    __Pascal Bourguignon__ http://www.informatimago.com/

    "You cannot really appreciate Dilbert unless you read it in the
    original Klingon"

+ Reply to Thread