diff options
author | Richard Braun <rbraun@sceen.net> | 2017-05-28 00:17:42 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-05-28 00:17:42 +0200 |
commit | 48c267a4ad218af8732e013c64b793166939a33e (patch) | |
tree | 5d42a965e3804880bfb5061329c661fff5d92ed8 /shell.c | |
parent | c42c173d8aab4887ee9b379b9123814a8a1b7690 (diff) |
shell: fix behaviour of del key
Diffstat (limited to 'shell.c')
-rw-r--r-- | shell.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -746,15 +746,16 @@ shell_process_left(void) printf("\e[1D"); } -static void +static int shell_process_right(void) { if (shell_cursor >= shell_line_size(shell_history_get_newest())) { - return; + return ERR_AGAIN; } shell_cursor++; printf("\e[1C"); + return 0; } static void @@ -923,7 +924,14 @@ shell_esc_seq_home(void) static void shell_esc_seq_del(void) { - shell_process_right(); + int error; + + error = shell_process_right(); + + if (error) { + return; + } + shell_process_backspace(); } |