On Tue, Aug 25, 2020 at 08:21:30AM -0400, [email protected] wrote:
> On Tue, 25 Aug 2020, hebisch-at-math.uni.wroc.pl |pop-forum| wrote:
>
> ...
> > > I haven't yet understood how vedescapetable gets its values. The file
> > > vedtermcap.p looks relevant, but is not easy to follow.
> > >
> >
> > I am affraid that this part is not implemented at all. AFAICS
> > vedescapetable gets some default value and this value is in
> > use.
> >
> > Using terminfo we should be doing something like this:
> >
> > /* Up arrow handler */
> > install_escape(termcap_getstring('ku'), vedcharup)
> > /* Down arrow handler */
> > install_escape(termcap_getstring('kd'), vedchardown)
> > ....
> >
> > where 'install_escape' should install appropriate entries in
> > vedescapetable. But I see no code like this. In fact, searching
> > code for string 'ku' or 'kd' gives me nothing...
>
> Thanks, Waldek. I'm reassured that it is not just me not knowing where to
> look.
>
> > So it seems that we need to write appropriate 'install_escape'
> > (it needs to handle multicharacter sequences, so may be a bit
> > more complicated than simple assignment) and do assignments
> > for known keys sequences. ATM I see no code like this...
>
> Isn't the code for vedsetkey in $usepop/pop/ved/src/vdsetkey.p doing the job
> of your install_escape? If I run non-x ved with TERM set to rxvt-unicode
> and do :vedsetkey('\^[OA',vedcharup) on the command line, the uparrow key
> starts behaving correctly. So might we just need a list of ved functions
> and their corresponding terminfo names?
vedsetkey looks close. IIUC difference is that strings that we
get from terminfo do not contain initial escape. For example:
termcap_getstring('ku') =>
** A
Terminfo manual contains list of terminfo names, we get one part
from here. AFAICS for xterm normal setup is done in
pop/lib/ved/term/vedxtermkeys.p (using also other reutines).
There is syntax word 'vedset' which eventually generates calls
to 'vedsetkey'.
--
Waldek Hebisch