summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-28 23:58:07 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-28 23:58:07 (EDT)
commit062fd4637d8f1d7ad39834586758c0fdaf64fa19 (patch)
tree510b5adf5a81e802d8ec4cd428078f00e048b126
parentabed96862ae06b59d07876b469586795860a3504 (diff)
downloadfirman.sh-062fd4637d8f1d7ad39834586758c0fdaf64fa19.zip
firman.sh-062fd4637d8f1d7ad39834586758c0fdaf64fa19.tar.gz
firman.sh-062fd4637d8f1d7ad39834586758c0fdaf64fa19.tar.bz2
tui_show_prompt(): Handle KEY_BACKSPACE, KEY_DEL, KEY_SPACE
-rw-r--r--src/ui/tui.sh10
1 files changed, 10 insertions, 0 deletions
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))