The Solution I used was from the
HP-UX/Sun Interoperability Cookbook
"http://iworks.ecn.uiowa.edu/Tech/sun_hpux_interop/chap13_log.html"
3.4.4 Setting the Correct Terminal Type
Setting the correct terminal type involves two main issues: terminal
emulation and keypad mapping.
13.4.4.1 Terminal Emulation
When there are problems with terminal emulation, the problems are
usually caused by vendors using proprietary emulators such as Sun's
commandtool or HP's hpterm. For example, when you remotely log into an
HP-UX system using a commandtool window, the sun-cmd terminal
type is unrecognized on the HP system.
A simple solution to this problem is to specify a terminal type of sun1
on the HP-UX system. Add the following lines to the HP-specific portion
of
the login script:
if [ "$TERM" = "sun-cmd" ]; then
export TERM=sun1
fi
A more permanent solution to the problem is to add the correct sun-cmd
entry into the terminfo database.
First, use infocmp on the SunOS 4.1.x system to retrieve a copy of the
sun-cmd description from the terminfo database:
sun% /usr/5bin/infocmp sun-cmd > sun-cmd.info
NOTE: Even though SunOS 4.1.x systems use the termcap database for
terminal definitions, terminfo information is available on the system.
Then, copy the sun-cmd.info file to the HP system and load the file into
the terminfo database:
hp% tic sun-cmd.info
This command creates a sun-cmd terminfo entry in the file
/usr/lib/terminfo/s/sun-cmd. This file then can be copied to other HP-UX
systems. You
may copy terminfo data files only between identical systems. You may not
copy a file from an HP-UX system to a Sun system.
Conversely, HP-UX users using an hpterm will find that their hpterm is
not defined on SunOS 4.1.x or Solaris 2.x systems.
Once again the simple solution is to specify a terminal type of hp:
sun% export TERM=hp
To create a valid entry on both SunOS 4.1.x and Solaris 2.x systems,
retrieve a copy of the terminfo definition using the untic command:
hp% untic hpterm > hpterm.info
Copy this file to the SunOS 4.1.x or Solaris 2.x system and issue the
following command:
sun% /usr/bin/tic hpterm.info
This command will compile the terminfo file and store the results in
/usr/share/lib/terminfo/h/hpterm.
On Solaris 2.x systems, you need take no further action.
On SunOS 4.1.x systems, there is one more step:
sunos% /usr/5bin/infocmp -C hpterm >> /etc/termcap
This command will append a valid termcap entry for hpterm to
/etc/termcap.
One additional step on HP-UX 9.x is setting the LINES and COLUMNS
environment variables. These variables must be set in order for window
resizing to work properly:
if [ -z "$LINES" ]
then
export LINES=`tput lines`
fi
if [ -z "$COLUMNS" ]
then
export COLUMNS=`tput cols`
fi
The tput command queries the terminfo database and retrieves the
appropriate value.