bug-ncurses
[Top][All Lists]
Advanced

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

Re: I don't understand ncurses dealing with control-ARROW


From: Thomas Dickey
Subject: Re: I don't understand ncurses dealing with control-ARROW
Date: Sun, 20 Dec 2015 18:44:11 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Dec 17, 2015 at 10:52:38PM +0100, Steffen Nurpmeso wrote:
> Hello,
> 
> this is not really a bug ... most likely that is.  It is the only
> list regarding ncurses, and so .. and maybe it is.  Well.
> 
> I'm currently rewriting some code that deals with termcap (being
> out of the question before) and don't actually understand how to
> get at the control-ARROW etc. modifiers.
> 
> Now let aside that i don't understand why the real terminal that
> is on right now generates ^[[5D (via "$ cat" and in the "Keyboard"
> setting) but tigetstr(3) gives me "0x1B(x5B([) 0x31(1) 0x3B(;)
> 0x35(5) 0x44(D)" -- even though that is the correct return for
> nsterm, yet TERM=screen.xterm-256color (over ssh) and infocmp(1)
> doesn't output anything for kLFT5.  How do you do that?  ..Is this
> interpolated given that kLFT=\E[1;2D for both?  (..Likely..)

no, it's not interpolated, but all explicit.  You have to add the "-x"
option of infocmp to see the extended/user-defined capabilities.

Comparing the output of these (nsterm with/without "-x"):

128a129,135
>       TS=\E]2;,
>       kDC5=\E[3;5~,
>       kDC7=\E[3;5~,
>       kLFT3=\Eb,
>       kLFT5=\E[1;5D,
>       kRIT3=\Ef,
>       kRIT5=\E[1;5C,
 
> My question is why this is kLFT5 given that Caps.keys says the
> capname will be kclft?  Also, for kclft there is a %k termcap
> mapping, but i couldn't find any hint on such a thing for kLFT5.

oh... I'd have to say that Caps.keys was experimental
 
20010804                                                                        
        + add Caps.keys example for experimental extended function keys
          (adapted from a patch by Ilya Zakharevich).

but that I did not take it into account when adding the xterm function
keys because (besides not thinking about it), there are many more
combinations of modifiers in xterm than the enumeration in Caps.keys
would handle.

Caps.keys is an example (like the other Caps.* files) which ncurses
could be compiled with, but I don't recall anyone actually using it.

> For me the worst is that i cannot give end-users just any hint on
> how to get at the actual name nor sequence, except by copy+pasting
> a small C program that queries kLFT5++ and returns what is true as
> opposed to what infocmp says for $TERM.  I'm thinking about
> deliberately violating ncurses (?) by using tigetstr() in
> conjunction with tgetent() when it is available.

I recommend using tigetstr, since tgetstr (termcap) won't handle the
longer names.

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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