How can I change the title in my hpterm titlebar? Updated: 03/25/01

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' "$@"
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 .

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>
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 error occurred while processing this directive]