diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-04-02 00:32:28 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-04-02 00:32:28 +0200 |
commit | 3eb3533fae6c43907adbd340b24bee79f709504e (patch) | |
tree | f431334e5ea19012beb8fa1229b88b17aa26907a | |
parent | b2d6839a8c025698cd80118331f21fa4bb459f02 (diff) |
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.
-rw-r--r-- | sfeed_curses.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |