• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • Last Modified:

Dynamic title on the xterm

Hi,

I would like to get the dynamic title on my xterm, depending on the directory I'm presently in.
Say if I'm in /home/indkish/specification, I need my xterm title(even when minimised) to show "Xterm indkish /home/indkish/specification" on it.

A prompt suggestion would be appreciated :)

Thanks.
0
indkish
Asked:
indkish
  • 2
1 Solution
 
sunnycoderCommented:
0
 
sunnycoderCommented:
indkish,

Also see
http://www.tldp.org/HOWTO/Xterm-Title-3.html
ESC]0;stringBEL -- Set icon name and window title to string
ESC]1;stringBEL -- Set icon name to string
ESC]2;stringBEL -- Set window title to string
http://www.tldp.org/HOWTO/Xterm-Title-6.html#ss6.1
http://www.tldp.org/HOWTO/Xterm-Title.html

http://www.tldp.org/HOWTO/Xterm-Title-4.html
This example produces a title of username@hostname: directory and a prompt of ksh$ .

case $TERM in
    xterm*)
        HOST=`hostname`
        PS1='^[]0;${USER}@${HOST}: ${PWD}^Gksh$ '
        ;;
    *)
        PS1='ksh$ '
        ;;
esac

Sunnycoder
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now