bug-ncurses
[Top][All Lists]
Advanced

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

terminfo: nsterm and Terminal.app 2.5.3 (343.7) from OS X 10.10


From: Leonardo Brondani Schenkel
Subject: terminfo: nsterm and Terminal.app 2.5.3 (343.7) from OS X 10.10
Date: Wed, 15 Apr 2015 12:31:54 +0200

Hello,

I would like to report some missing key mappings and apparent key inconsistencies between the default, out-of-the-box behavior of Terminal.app 2.5.3 (343.7) shipped with OS X 10.10 and the definition of 'nsterm' in the latest terminfo database (version 1.525, 2014-10-19 01:16:56).

For reference, this is the output of 'infocmp' when $TERM=="nsterm":

nsterm|Apple_Terminal|AppKit Terminal.app,
        am, bce, hs, mir, msgr, npc, xenl, xon,
        colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
        clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
        dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
        enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
        home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
        ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
        ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
        kdch1=\E[3~, kend=\E[F, kent=\EOM, kf1=\EOP, kf10=\E[21~,
        kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
        kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[22~,
        kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
        kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
        khome=\E[H, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
        rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
        rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
        rmso=\E[m, rmul=\E[m,
        rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
        setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
        setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
        
sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
        sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
        smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
        tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
        u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd,

Out-of-the box Terminal.app is configured to generate the following sequences that are not described in terminfo:

kLFT=\E[1;2D
kLFT3=\Eb
kLFT5=\E[1;5D
kRIT=\E[1;2C
kRIT3=\Ef
kRIT5=\E[1;2C
kDC=\E[3;2~
kDC5=\E[3;5~
kDC7=\E\E[3;5~
kcbt=\E[Z

I suggest that these new capabilities are added to 'nsterm-bce'. The comments above that entry seem to mention the existence of these bindings but I am not sure why they were not included. (Unfortunately I don't have access to a pre-OS X 10.10 installation, so I can't really confirm if all those bindings were the same in old versions of Terminal.app.)

This is probably well-known, but the arrows and Home/End send different sequences:

        1       2
kuu1    \E[A    \E[OA
kud1    \E[B    \E[OB
kuf1    \E[C    \E[OC
kub1    \E[D    \E[OD
khome   \E[H    \E[OH
kend    \E[F    \E[OF

Terminal.app starts in "mode 1" and switches to "mode 2" when it receives a 'smkx' (defined as \E[?1h\E=) and stays in "mode 2" until it receives a 'rmkx' (defined as \E[?1l\E>) and reverts back to "mode 1".

However, compare this to the 'nsterm' entry in terminfo:

kcub1=\EOD, (mode 2)
kcud1=\EOB, (mode 2)
kcuf1=\EOC, (mode 2)
kcuu1=\EOA, (mode 2)
kend=\E[F,  (mode 1)
khome=\E[H, (mode 1)

You can see that the expected mode of the Home/End keys do not match the mode of the arrow keys, so either one of them will be wrong in any of the two modes. I suspect that the intent was for terminfo to have mappings for "mode 2" — if I'm correct, then 'nsterm-bce' should be changed so:

kend=\E[OF, khome=\E[OH

or even better:

use=xterm+app

Maybe these changes could even be made to 'nsterm-16color', but then again I can't really test old versions of Terminal.app.

It may be worth noticing that by default PageUp/PageDn/Home/End are not sent to the application but are used by Terminal.app to scroll its buffer and to send those keys it's necessary to simultaneously press the Shift key. However, if the terminal is in the alternate screen then the behavior is reversed: these keys are sent directly to the application and by pressing Shift you can scroll the buffer.

What is your opinion about these proposed changes? Are they reasonable?

Cheers,
// Leonardo.




reply via email to

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