Subject: Re: Using Pine & Pico on Wyse 60 terminals

From: "MAS Inc." <[email-masked]>
Date: Tue, 28 May 1996 09:37:10 -0700

On 22 May 1996, Eberto de Armas, Jr. wrote:

> I just got a copy of Pine 3.91 and it seems like a very good e-mail
> package.
>
> I need some help making Pine and Pico work with Wyse 60 terminals.
> I am trying to get the arrow and function keys to work.
>
> I was able to modify Pine to work ok (a few changes to ttyin.c), but I
> am having trouble modifying Pico.
>
> Does anyone know of a port that handles Wyse 60's?
>
> Or can someone direct me to the routines that I would need to monidy in
> Pico to add the Wyse 60 arrow and function keys?
>
> Any help or hints would be greatly appreciated.
>
> Thanks in advance,
> Eberto

In addition to Mr Gering's excellent reply, may I offer our company's
solution to the same problem: we simply wrote a series and Unix scripts
that program and reset the arrow and other function keys, which I've
attached.  Install these in your local bin directory and then type "wpine"
instead of pine.

Our company could not use the Ansi terminal solution Mr. Gering described
(which is, as he says, the best solution) because of our commitment to
non-Ansi programs.

The only caveat with these scripts: if you use any kind of task-switching
program (like mscreen) you will find your function keys don't work in the
other tasks.  Switch back to pine, exit, then switch to the other task.

Hope this helps.  Good luck.

---MAS Inc.			   email: [email-masked]
   15050 SW Koll Parkway, Suite C    web: http://www.teleport.com/~masi
   Beaverton, OR  97006		   phone: (503) 641-6200
#
# wpine - make arrow (and other) keys work in pine on Wyse-type terminals
#

if [ $TERM = "altos7" -o $TERM = "wyse60" -o $TERM = "wy60" ]
then
	trap wyse.pine.reset 0 1 2 3 15
	wyse.pine.setup
fi

pine
#
# wyse.pine.setup - Setup some keys on a Wyse terminal to work in pine
#
# Programming Wyse 160 keys has this format:
#	ESC Z direction keycode sequence DEL
#		direction = 1, remote
#		keycode = which key you're programming
#		sequence is terminated by a DEL
#		\c tells echo not to add a carriage return at the end of the string

echo "\nSetting up Wyse arrow and function keys..."

# Next/Prev Page

echo "\033Z1r \0177\c"
echo "\033Z1w-\0177\c"

# Char/Line delete

echo "\033Z15\04\0177\c"
echo "\033Z16\013\0177\c"

# Arrow keys

echo "\033Z1+\033[A\0177\c"
echo "\033Z1,\033[B\0177\c"
echo "\033Z1.\033[C\0177\c"
echo "\033Z1-\033[D\0177\c"

echo "Done\n"
#
# wyse.pine.reset - Reset standard Wyse keys
#

echo "\nResetting standard Wyse arrow/function keys..."

# Next/Prev Page

echo "\033Z1r\0177\c"
echo "\033Z1w\0177\c"

# Char/Line delete

echo "\033Z15\0177\c"
echo "\033Z16\0177\c"

# Arrow keys

echo "\033Z1+\0177\c"
echo "\033Z1.\0177\c"
echo "\033Z1,\0177\c"
echo "\033Z1-\0177\c"

echo "Done.\n"