Hi Tim,

> I sometimes think the same about the default tty signal mapping of
> Ctrl-\ for SIGQUIT -- the two keys appear next to either other on this
> keyboard, so is easy for e.g. a cat to type (or even a mis-typed
> Ctrl-Z undo attempt).

I typed this TTY's QUIT character on Wednesday by accident.  Here, it's
also defined as Ctrl-\.  But I typed Ctrl-Shift-4; I probably wanted ‘$’
but Ctrl was still on its way up.

Actually, the Shift isn't required; Ctrl-4 does SIGQUIT too, and not
because of the bit-twiddling reason that Ctrl-2 gives NUL just as Ctrl-@
should: that Shift-2 is ‘"’.  xterm's input.c says it's an X thing, but
I haven't found anything else about it:

     * X "normally" has some built-in translations, which the user may want to
     * suppress when processing the modifyOtherKeys resource.  In particular, 
the
     * control modifier applied to some of the keyboard digits gives results for
     * control characters.

Here's me entering Ctrl-1, Ctrl-2, ... up to Ctrl-0 and then Enter.

    $ stty raw; \
    > ((timeout --foreground 4.2 dd bs=1; stty cooked; echo >&3) | hd) 3>&1
    1^@^[^\^]^^^_^?9^M
    00000000  31 00 1b 1c 1d 1e 1f 7f  39 0d                    |1.......9.|
    0000000a
    $

You can see the TTY's ‘ctlecho’ setting causing Ctrl-2 to be echoed as
‘^@’, NUL, and that's confirmed by the hex dump.  0x1c is backslash,
0x5c, with Ctrl masking off 0x40.

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to