Re: [dev] [st] Terminal abnormal key codes

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Tue, 1 Sep 2015 16:40:12 +0200

On Tue, Sep 01, 2015 at 10:22:52PM +0800, Pickfire wrote:
> Hi, it seems that st does some terminal codes abnormally[1].
>
> What is the reason for st's key codes to be different from the other
> terminals? Is st following some standards?
>
> [1]: https://github.com/fish-shell/fish-shell/issues/2309#issuecomment-136678774

Yes, st follows terminfo(5). Every terminal has different keys,
so, I don't know what you mean with st using different keys.
You can see the differences between xterm an linux vt:

$ infocmp xterm linux

comparing xterm to linux.
    comparing booleans.
        ccc: F:T.
        eo: F:T.
        km: T:F.
        mc5i: T:F.
        npc: T:F.
        xon: F:T.
    comparing numbers.
        cols: 80, NULL.
        lines: 24, NULL.
        ncv: NULL, 18.
    comparing strings.
        acsc: '``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~', '+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376'.
        cbt: '\E[Z', NULL.
        civis: '\E[?25l', '\E[?25l\E[?1c'.
        clear: '\E[H\E[2J', '\E[H\E[J'.
        cnorm: '\E[?12l\E[?25h', '\E[?25h\E[?0c'.
        cvvis: '\E[?12;25h', '\E[?25h\E[?8c'.
        dim: NULL, '\E[2m'.
        flash: '\E[?5h$<100/>\E[?5l', '\E[?5h\E[?5l$<200/>'.
        ich1: NULL, '\E[_AT_'.
        indn: '\E[%p1%dS', NULL.
        initc: NULL, '\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x'.
        invis: '\E[8m', NULL.
        is2: '\E[!p\E[?3;4l\E[4l\E>', NULL.
        kDC: '\E[3;2~', NULL.
        kEND: '\E[1;2F', NULL.
        kHOM: '\E[1;2H', NULL.
        kIC: '\E[2;2~', NULL.
        kLFT: '\E[1;2D', NULL.
        kNXT: '\E[6;2~', NULL.
        kPRV: '\E[5;2~', NULL.
        kRIT: '\E[1;2C', NULL.
        kb2: '\EOE', '\E[G'.
        kbs: '^H', '^?'.
        kcub1: '\EOD', '\E[D'.
        kcud1: '\EOB', '\E[B'.
        kcuf1: '\EOC', '\E[C'.
        kcuu1: '\EOA', '\E[A'.
        kend: '\EOF', '\E[4~'.
        kent: '\EOM', NULL.
        kf1: '\EOP', '\E[[A'.
        kf13: '\E[1;2P', '\E[25~'.
        kf14: '\E[1;2Q', '\E[26~'.
        kf15: '\E[1;2R', '\E[28~'.
        kf16: '\E[1;2S', '\E[29~'.
        kf17: '\E[15;2~', '\E[31~'.
        kf18: '\E[17;2~', '\E[32~'.
        kf19: '\E[18;2~', '\E[33~'.
        kf2: '\EOQ', '\E[[B'.
        kf20: '\E[19;2~', '\E[34~'.
        kf21: '\E[20;2~', NULL.
        kf22: '\E[21;2~', NULL.
        kf23: '\E[23;2~', NULL.
        kf24: '\E[24;2~', NULL.
        kf25: '\E[1;5P', NULL.
        kf26: '\E[1;5Q', NULL.
        kf27: '\E[1;5R', NULL.
        kf28: '\E[1;5S', NULL.
        kf29: '\E[15;5~', NULL.
        kf3: '\EOR', '\E[[C'.
        kf30: '\E[17;5~', NULL.
        kf31: '\E[18;5~', NULL.
        kf32: '\E[19;5~', NULL.
        kf33: '\E[20;5~', NULL.
        kf34: '\E[21;5~', NULL.
        kf35: '\E[23;5~', NULL.
        kf36: '\E[24;5~', NULL.
        kf37: '\E[1;6P', NULL.
        kf38: '\E[1;6Q', NULL.
        kf39: '\E[1;6R', NULL.
        kf4: '\EOS', '\E[[D'.
        kf40: '\E[1;6S', NULL.
        kf41: '\E[15;6~', NULL.
        kf42: '\E[17;6~', NULL.
        kf43: '\E[18;6~', NULL.
        kf44: '\E[19;6~', NULL.
        kf45: '\E[20;6~', NULL.
        kf46: '\E[21;6~', NULL.
        kf47: '\E[23;6~', NULL.
        kf48: '\E[24;6~', NULL.
        kf49: '\E[1;3P', NULL.
        kf5: '\E[15~', '\E[[E'.
        kf50: '\E[1;3Q', NULL.
        kf51: '\E[1;3R', NULL.
        kf52: '\E[1;3S', NULL.
        kf53: '\E[15;3~', NULL.
        kf54: '\E[17;3~', NULL.
        kf55: '\E[18;3~', NULL.
        kf56: '\E[19;3~', NULL.
        kf57: '\E[20;3~', NULL.
        kf58: '\E[21;3~', NULL.
        kf59: '\E[23;3~', NULL.
        kf60: '\E[24;3~', NULL.
        kf61: '\E[1;4P', NULL.
        kf62: '\E[1;4Q', NULL.
        kf63: '\E[1;4R', NULL.
        khome: '\EOH', '\E[1~'.
        kind: '\E[1;2B', NULL.
        kri: '\E[1;2A', NULL.
        kspd: NULL, '^Z'.
        mc0: '\E[i', NULL.
        mc4: '\E[4i', NULL.
        mc5: '\E[5i', NULL.
        nel: NULL, '^M^J'.
        oc: NULL, '\E]R'.
        rin: '\E[%p1%dT', NULL.
        rmacs: '\E(B', '\E[10m'.
        rmcup: '\E[?1049l', NULL.
        rmkx: '\E[?1l\E>', NULL.
        rmm: '\E[?1034l', NULL.
        rmpch: NULL, '\E[10m'.
        rs1: '\Ec', '\Ec\E]R'.
        rs2: '\E[!p\E[?3;4l\E[4l\E>', NULL.
        setb: '\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', NULL.
        setf: '\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', NULL.
        sgr: '%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m', '\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m'.
        sgr0: '\E(B\E[m', '\E[0;10m'.
        smacs: '\E(0', '\E[11m'.
        smcup: '\E[?1049h', NULL.
        smkx: '\E[?1h\E=', NULL.
        smm: '\E[?1034h', NULL.
        smpch: NULL, '\E[11m'.
        u8: '\E[?1;2c', '\E[?6c'.


If your program does not use terminfo(3)
(http://linux.die.net/man/3/setupterm), then is broken.
About the problems with DELETE, please take a look to
the FAQ (section Why doesn't the Del key work in some programs?)


Regards,
Received on Tue Sep 01 2015 - 16:40:12 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2015 - 16:48:09 CEST