Skip to content

Commit

Permalink
Start a proper ignore section in the dictionary of sequences
Browse files Browse the repository at this point in the history
And by "proper ignore section" I simply mean: have the sequences we want to
ignore all gathered together in a really obvious location, and with some
sort of explanation.
  • Loading branch information
davep committed Dec 4, 2023
1 parent 5f03930 commit 6d41f14
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/textual/_ansi_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@
# Tmux (Win32 subsystem) sends the following scroll events.
"\x1b[62~": (Keys.ScrollUp,),
"\x1b[63~": (Keys.ScrollDown,),
# --
# Sequences generated by numpad 5. Not sure what it means. (It doesn't
# appear in 'infocmp'. Just ignore.
"\x1b[E": (Keys.Ignore,), # Xterm.
"\x1b[G": (Keys.Ignore,), # Linux console.
# --
# Meta/control/escape + pageup/pagedown/insert/delete.
"\x1b[3;2~": (Keys.ShiftDelete,), # xterm, gnome-terminal.
"\x1b[3$": (Keys.ShiftDelete,), # rxvt
Expand Down Expand Up @@ -370,6 +364,15 @@
"\x1bOx": "8",
"\x1bOy": "9",
"\x1bOM": (Keys.Enter,),
############################################################################
# The ignore section. Only add sequences here if they are going to be
# ignored. Also, when adding a sequence here, please include a note as
# to why it is being ignored; ideally citing sources if possible.
############################################################################
# The following 2 are inherited from prompt toolkit. They relate to a
# press of 5 on the numeric keypad, when *not* in number mode.
"\x1b[E": (Keys.Ignore,), # Xterm.
"\x1b[G": (Keys.Ignore,), # Linux console.
}

# https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
Expand Down

0 comments on commit 6d41f14

Please sign in to comment.