On 2020-05-06 11:44:06 +0200, Christopher Zimmermann wrote: > Hello dear mutt developers, > > I prepared a merge request that needs some consideration. > > Why? I use mutt on OpenBSD with heavily customized vi-like key bindings and > colouring. Especially I'm used to line-wise scrolling being bound to \Ce and > \Cy. \Cy can not be bound using the ncurses backend on OpenBSD because the > terminal will interpret \Cy as delayed suspend (stty dsusp). > Because of this problem I used to use the slang backend. But this in turn > messes up colouring (I don't know why and didn't try to figure it out). To > improve colouring I just switched back to curses and finally found out about > `stty dsusp undef`, which does fix the \Cy issue. > But I was also wondering why vim had no problems binding \Cy. After some > research I found out about curses' raw and cbreak modes[1]. Mutt uses cbreak > and therefore the terminal will still catch and interpret \Cc (SIGINT), \034 > (SIGQUIT), \Cy (SIGSTOP on next read), \Cz (SIGSTOP). Those keys can't be > bound.
On my Mutt pages https://www.vinc17.net/mutt/index.en.html I mention a little script apptty which I have used with Mutt in GNU screen for more than 12 years, with in particular: stty susp undef stty dsusp undef 2> /dev/null Like susp (^Z by default) and dsusp (^Y when it exists), you can normally disable whatever you wish. "stty -a" gives the current mappings. > Because users should not need to understand terminal intrinsics to that > depth mutt should maybe rather use the raw mode to interpret those > characters on its own. The merge request[2] does just that and will switch > to use raw instead of cbreak mode. > > New functions `suspend` and `interrupt` are implemented. > `suspend` is used to trigger SIGTSTP and is bound to \Cz by default. > `interrupt` calls `mutt_query_exit` and is used to mimic the \Cc behaviour. > The latter function is almost superfluous because there already is `quit` > and `exit`. It's only really needed to quit from the line editor and might > have a slightly different behaviour depending on the `quit` quadoption. That's bad because it doesn't honor the way the user has configured his terminal. Moreover, I fear that in case of crash, this may leave the terminal settings in the altered state (zsh offers protection, though). -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)