Skip to content

alt/meta-backspace is interpreted as esc + backspace #5

@lspitzner

Description

@lspitzner

I have observed on multiple (but random) times that alt-backspace exits my program without any trace of an error message, instead of it doing what the program is supposed to do on alt-backspace (which is not to halt). Had me confused, but, looking at

specialSupportKeys =
    [ -- special support for ESC
      ("\ESC",EvKey KEsc []), ("\ESC\ESC",EvKey KEsc [MMeta])
    -- Special support for backspace
    , ("\DEL",EvKey KBS []), ("\ESC\DEL",EvKey KBS [MMeta])
    -- Special support for Enter
    , ("\ESC\^J",EvKey KEnter [MMeta]), ("\^J",EvKey KEnter [])
    -- explicit support for tab
    , ("\t", EvKey (KChar '\t') [])
    ]

This makes a good amount of sense - if the input buffer for some reason contains only \ESC (part of a \ESC\DEL) then the input sequence is interpreted as the sequence of \ESC (and \DEL once the next part is read). This depends on where the input is split up due to input-buffering internals, which of course is mildly random.

(A plain Esc is treated by my program to exit cleanly, which explains my initial observation.)

Does this diagnosis make sense so far?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions