From 3eb3533fae6c43907adbd340b24bee79f709504e Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 2 Apr 2022 00:32:28 +0200 Subject: sfeed_curses: line editor, temporarily disable the mouse when using the line editor This allows pasting in the terminal and also doesnt spam mouse events, which are not useful here. --- sfeed_curses.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sfeed_curses.c b/sfeed_curses.c index 4f92115..a12b41f 100644 --- a/sfeed_curses.c +++ b/sfeed_curses.c @@ -983,6 +983,8 @@ lineeditor(void) size_t cap = 0, nchars = 0; int ch; + if (usemouse) + mousemode(0); for (;;) { if (nchars + 2 >= cap) { cap = cap ? cap * 2 : 32; @@ -1011,9 +1013,12 @@ lineeditor(void) else /* no signal, time-out or SIGCHLD or SIGWINCH */ continue; /* do not cancel: process signal later */ free(input); - return NULL; /* cancel prompt */ + input = NULL; + break; /* cancel prompt */ } } + if (usemouse) + mousemode(usemouse); return input; } -- cgit v1.2.3