diff options
author | Kevin McCarthy <kevin@8t8.us> | 2021-07-22 15:44:42 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-07-24 17:36:21 -0700 |
commit | f4ff768c2764502a974042e1fe9d861a7a92fbcf (patch) | |
tree | d94b884f09266a5281337deeef611c37a8f30908 /main.c | |
parent | e0232be752902950e379b8bb4bd84699d3781bb5 (diff) |
Enable nonl() mode for ncurses. closes #362.
This patch is based on the patch from Mike Frysinger, archived from
the old trac system at:
https://gitlab.com/muttmua/trac-tickets/-/blob/master/attachments/3494/mutt-enter-return-hg-6658.patch
This version creates a new key symbol, <KeypadEnter> for the KEY_ENTER
value returned by getch(). According to Vincent Lefèvre's research,
that corresponds to the "key pad" Enter key. If KEY_ENTER is not
defined, it binds the symbol to "\n". It does this after the
KeyNames[] definitions of <Enter> and <Return> so they remain the
default shown by <what-key>.
Since Mutt already accepts KEY_ENTER at the y/n prompt, add it for all
the built-in operations too.
Bindings with "\r" and "\n" in the binding_t structures don't need
"<enter>" and "<return>" to be re-specified in km_init(), so remove
those. Instead add the "<KeypadEnter>" bindings there.
Remove unnecessary Alias menu bindings for OP_GENERIC_SELECT_ENTRY in
km_init().
As a note: I don't believe non-extended key symbol bindings need to be
bound inside km_init(). I'm not clear why this was done, or what
purpose it serves. I'll do a bit more research, but if I can't
uncover any issues, will move them inside the binding_t structures in
another commit.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -604,6 +604,7 @@ static void start_curses (void) keypad (stdscr, TRUE); cbreak (); noecho (); + nonl (); #if HAVE_TYPEAHEAD typeahead (-1); /* simulate smooth scrolling */ #endif |