summaryrefslogtreecommitdiff
path: root/shell.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-05-28 00:17:42 +0200
committerRichard Braun <rbraun@sceen.net>2017-05-28 00:17:42 +0200
commit48c267a4ad218af8732e013c64b793166939a33e (patch)
tree5d42a965e3804880bfb5061329c661fff5d92ed8 /shell.c
parentc42c173d8aab4887ee9b379b9123814a8a1b7690 (diff)
shell: fix behaviour of del key
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/shell.c b/shell.c
index b2cb42f..3f5c7c6 100644
--- a/shell.c
+++ b/shell.c
@@ -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();
}