Parent document is top of "comp.sys.hp.hpux FAQ"
Previous document is "6.3 How do I get a scroll bar on hpterms?"
Next document is "6.5 How come my hpterms keep going away by themselves?"

6.4 How can I put a title in my hpterm titlebar?

Here is a two line program that you might find useful:

/* 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]);
}

An alternative is:

#!/bin/sh
LENGTH=`strlen $1`
echo "&f0k${LENGTH}D$1\c"

That's ESC between the first quote and the f0k.

strlen, in case you don't have it, comes from:

#include <stdio.h>

main(argc, argv)
   int argc;
   int *argv[];
{
   if (argc != 2)
      exit(0);
   printf("%d\n", strlen(argv[1]));
}

To set the title in the icon:

#!/bin/sh
LENGTH=`strlen $1`
echo "&f-1k${LENGTH}D$1\c"

Where the & is ESC.

(Thanks to Tom Arons <arons@ash.eecs.ucdavis.edu> and John T. Beck, HP.)

Parent document is top of "comp.sys.hp.hpux FAQ"
Previous document is "6.3 How do I get a scroll bar on hpterms?"
Next document is "6.5 How come my hpterms keep going away by themselves?"