On Fri, Jul 31, 2009 at 08:49:15PM +0000, 4625 wrote:
> How to achieve the adequate behaviour on pressing keys F1-F10 in GoldED+ 
> (message editor); 'HOME' - return to begin of line, 'END' - end of line 
> in bash prompt and some text/message editors?
> 
> I will explain the problem.
> 
> Golded+: F1-F5 keys should offer a lot of different functions (help, 
> save, reply, etc...), but offer only 'Quit' actually. Message index 
> should be appear on key F9, but it will happen on key F10 actually. On 
> key F5 should be menu 'Answer In Area'. Such menu on F6 actually. The 
> same problems in Midnight Commander. 'Alt-S', 'Alt-P', 'Alt-I', etc - 
> should set message attributes, but display cyrillic letter actually.
> 
> 'HOME' and 'END' keys will display the '~' almost everywhere in OpenBSD 
> console.
> 
> --
> 4625

When wscons was imported in OpenBSD, they made odd decisions. Or
kept NetBSD assumptions.

wscons simulate perfectly an ANSI keyboard on almost all arch.
Exactly how my Wyse 520 terminal does it. (Except END/HOME have are
new codes and don't just reuse FIND/SELECT codes like many terminfo
entries do.)

My issues with that are:

1. Consoles set TERM to vt220 (/etc/ttys). The terminfo key information
recorded for vt220 doesn't match what wscons keyboard generates.
Perfectly good application getting they key sequence from the
terminfo database can't correctly use F1-F10, HOME and END keys
because of that.

Since wscons is a virtual layer, it would not have cost much to
have the keyboard generates key sequences from the default TERM
OpenBSD sets the console. 

2. termcap/terminfo databases are incorporated in 100s of unix-like
operating system. Changes or new entries can take a while to get
distributed everywhere. Taking a well distributed entry and simulating
it completly can be more helpfull for cross compatibility than being
right about how a hardware vt100/vt220 behave.

3. In pcvt times, keys matched the vt220 terminfo definitions.

What I don't know:

1. Do vt100/vt220 terminals always shipped with that keyboard? The
few terminal manufacturer left seem to all ship with PC like keyboards
now with sometimes an ANSI keyboard option. (I was actually lent
shortly a PS2 compatible ANSI keyboard recently. Didn't know they
existed.)

2. Why in the decades of their existances (keyboards, vt220, vt100,
termcap/terminfo database) there is no vt100 or vt220 like entries
that correspond to what wscons beleive vt100/vt220 behave.

3. wscons is a generic driver for all architecture, maybe this
behavior is important for one of them. I don't see why
i386/macppc/mac68k/hppa needs that. sparc set TERM to "sun" so
that's ok. The other ones I don't know.



To the OP, the generic OpenBSD answer is use X.

I might try to make a wsemul_vt100_keys.c patch and test it. Turn
my rant in something usefull. At least send a proper bug report for
this. 



--
Hugo Villeneuve <harpa...@jwales.eintr.net>

Reply via email to