Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoMeyer441 committed Oct 11, 2022
2 parents e38ffae + 491aa66 commit 588b1b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Overview

`simple-term-menu` creates simple menus for interactive command line programs. It can be used to offer a choice of
different options to the user. Menu entries can be selected with the arrow or j/k keys. The module uses the terminfo
database to detect terminal features automatically and disables styles that are not available.
different options to the user. Menu entries can be selected with the arrow, j/k, or emacs (C-n/C-p) keys. The module
uses the terminfo database to detect terminal features automatically and disables styles that are not available.
Currently, Linux and macOS are supported.

## Breaking changes
Expand Down
11 changes: 7 additions & 4 deletions simple_term_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
__email__ = "i.meyer@fz-juelich.de"
__copyright__ = "Copyright © 2021 Forschungszentrum Jülich GmbH. All rights reserved."
__license__ = "MIT"
__version_info__ = (1, 5, 1)
__version_info__ = (1, 5, 2)
__version__ = ".".join(map(str, __version_info__))


Expand All @@ -64,7 +64,7 @@
DEFAULT_PREVIEW_BORDER = True
DEFAULT_PREVIEW_SIZE = 0.25
DEFAULT_PREVIEW_TITLE = "preview"
DEFAULT_QUIT_KEYS = ("escape", "q")
DEFAULT_QUIT_KEYS = ("escape", "q", "ctrl-g")
DEFAULT_SEARCH_CASE_SENSITIVE = False
DEFAULT_SEARCH_HIGHLIGHT_STYLE = ("fg_black", "bg_yellow", "bold")
DEFAULT_SEARCH_KEY = "/"
Expand Down Expand Up @@ -540,8 +540,11 @@ def must_scroll(self) -> bool:
"backspace": "", # Is assigned later in `self._init_backspace_control_character`
"ctrl-a": "\001",
"ctrl-e": "\005",
"ctrl-g": "\007",
"ctrl-j": "\012",
"ctrl-k": "\013",
"ctrl-n": "\016",
"ctrl-p": "\020",
"enter": "\015",
"escape": "\033",
"tab": "\t",
Expand Down Expand Up @@ -1470,8 +1473,8 @@ def remove_letter_keys(menu_action_to_keys: Dict[str, Set[Optional[str]]]) -> No
try:
init_signal_handling()
menu_action_to_keys = {
"menu_up": set(("up", "ctrl-k", "k")),
"menu_down": set(("down", "ctrl-j", "j")),
"menu_up": set(("up", "ctrl-k", "ctrl-p", "k")),
"menu_down": set(("down", "ctrl-j", "ctrl-n", "j")),
"menu_start": set(("home", "ctrl-a")),
"menu_end": set(("end", "ctrl-e")),
"accept": set(self._accept_keys),
Expand Down

0 comments on commit 588b1b6

Please sign in to comment.