From 062fd4637d8f1d7ad39834586758c0fdaf64fa19 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 28 Oct 2015 23:58:07 -0400 Subject: tui_show_prompt(): Handle KEY_BACKSPACE, KEY_DEL, KEY_SPACE --- (limited to 'src/ui') diff --git a/src/ui/tui.sh b/src/ui/tui.sh index 40a2857..c3d447c 100644 --- a/src/ui/tui.sh +++ b/src/ui/tui.sh @@ -246,7 +246,17 @@ tui_show_prompt() elif [ ${focus} -eq 0 ]; then case "${key}" in KEY_ENTER) break;; + KEY_BACKSPACE) + input="${input%?}" + curpos=$(($curpos - 1)) + ;; + KEY_DEL) + ;; # TODO: Line editing + KEY_SPACE) + input="${input} " + curpos=$(($curpos + 1)) + ;; *) input="${input}${key}" curpos=$(($curpos + 1)) -- cgit v0.9.1