Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 5.15.1.5 How can I change the title in my hpterm titlebar?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Houses ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.15.1.4 How do I get a scroll bar on hpterms?
Next Document: 5.15.1.6 Why do my terminal windows keep going away by themselves?
See reader questions & answers on this topic! - Help others by sharing your knowledge

From the command-line
=====================
LEN=`echo "$1\c" | wc -c`
echo "\033&f0k${LEN}D${1}\c"   # set title bar name
echo "\033&f-1k${LEN}D${1}\c"  # set icon name

You can stick the following lines in your .profile or .kshrc to display
the system name and current directory in your hpterm title bar & icon:

if [ "$TERM" = hpterm ]; then
   alias cd=Hcd
   Hcd ()
   {
      if [ $# -ne 0 ]; then
         'cd' "$@"
      else
         'cd'
      fi
      NAME="$(uname -n):${PWD}"
      LEN=`echo "$NAME\c" | wc -c`
      # reset name of hpterm title bar & icon to $NAME
      echo "\033&f0k${LEN}D${NAME}\c"   # set title bar name
      echo "\033&f-1k${LEN}D${NAME}\c"  # set icon name
   }
   Hcd .
fi

Programmatically:
=================
Here's a two-line C program that'll do the trick:

/* Quick and dirty program to put argv[1] in the title bar of an hpterm
   Tom Arons, March 1992
*/
#include <string.h>
main(argc,argv)
int argc; char **argv;
{
   printf("\033&f0k%dD%s", strlen(argv[1]), argv[1]);
   printf("\033&f-1k%dD%s", strlen(argv[1]), argv[1]);
}

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.15.1.4 How do I get a scroll bar on hpterms?
Next Document: 5.15.1.6 Why do my terminal windows keep going away by themselves?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM