bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update terminfo entry for 'iterm'


From: Thomas Dickey
Subject: Re: Update terminfo entry for 'iterm'
Date: Sun, 27 Aug 2017 20:52:54 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Aug 27, 2017 at 09:47:17PM +0200, Leonardo Brondani Schenkel wrote:
> On 2017-08-25 22:36, Thomas Dickey wrote:
> >On Fri, Aug 25, 2017 at 03:27:56PM +0200, Leonardo Brondani Schenkel wrote:
> >>Sorry about just mentioning this now, but I overlooked the fact that
> >>the shifted arrows are represented as (for example) kLFT2 and kLFT
> >>is missing. Was that deliberate? What's the reasoning? I also
> >>noticed that 'iterm' is the only entry in the whole file that uses
> >>kLFT2 instead of kLFT.
> >
> >That's now, but a while back before I realized that kri / kind would
> >work for kDN2 / kUP2, I had a few like that (will fix, as well as
> >adding a warning in tic to remind me...)
> 
> I read the man pages but I'm still confused: could you clarify about
> the semantics of 'kri'/'kind', how they relate to 'kUP'/'kDN' and

When I've added kUP/kDN, they're intended to be the same (just making
names which are easier to recognize that they're shifted-keys).

Bear in mind that the standard terminfo doesn't mention that they're shifted
keys:

       key_sf                         kind        kF         scroll-forward key
       key_sr                         kri         kR         scroll-backward key

and also that (standard) terminfo doesn't have kUP/kDN which one would expect
for completeness, given these:

       key_sleft                      kLFT        #4         shifted left-arrow
                                                             key
       key_sright                     kRIT        %i         shifted right-arrow
                                                             key

You've probably seen terminals which respond to shifted pageup/pagedown.
Very likely someone back ~30 years ago decided that shifted cursor up/down
should be used for scrolling up/down by one line.  A likely suspect would
be something like this:

        att4415|tty5420|att5420|AT&T 4415/5420 80 cols,

which has kri/kind, but no kLFT/kRIT.

On the other hand, these have both:

        att510a|bct510a|AT&T 510A Personal Terminal,
        att510d|bct510d|AT&T 510D Personal Terminal,
        att500|att513|AT&T 513 using page mode,
        att605|AT&T 605 80 column 102key keyboard,
        att610|AT&T 610; 80 column; 98key keyboard,

> when you would use one or the other? Some definitions have both, for
> example, 'xterm-256color', while on 'iterm2' you included only the
> former.

Using standard names is preferred for portability.  But the relationship of
kind/kri to shifted cursor-keys is too obscure to say that it's standard...

I do have a warning for that:

"terminfo.src", terminal 'xterm-new': Conflicting key definitions (using the 
last)
... KEY_SF (capability "kind") is the same as capability "kDN"
... KEY_SR (capability "kri") is the same as capability "kUP"

but in practice, applications can ask for either by name.  In ncurses, the
wgetch function will return the code for the standard one (since it'll always
be earlier in the table):

#define KEY_SLEFT       0611            /* shifted left-arrow key */
#define KEY_SRIGHT      0622            /* shifted right-arrow key */

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]