diff options
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-key.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c index a07727d9d..a303b4f77 100644 --- a/src/gui/curses/gui-curses-key.c +++ b/src/gui/curses/gui-curses-key.c @@ -509,7 +509,13 @@ gui_key_read_cb (void *data, int fd) for (i = 0; i < ret; i++) { - gui_key_buffer_add (buffer[i]); + /* add all chars (ignore a '\n' after a '\r') */ + if ((i == 0) + || (buffer[i] != '\n') + || (buffer[i - 1] != '\r')) + { + gui_key_buffer_add (buffer[i]); + } } text_added_to_buffer = 1; |