summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ui/tui.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ui/tui.sh b/src/ui/tui.sh
index 74211d7..5c88f23 100644
--- a/src/ui/tui.sh
+++ b/src/ui/tui.sh
@@ -251,6 +251,16 @@ tui_show_prompt()
elif [ ${focus} -eq 0 ]; then
case "${key}" in
KEY_ENTER) break;;
+ KEY_LEFT)
+ if [ ${curpos} -gt 0 ]; then
+ curpos=$(($curpos - 1))
+ fi
+ ;;
+ KEY_RIGHT)
+ if [ ${curpos} -lt ${#input} ]; then
+ curpos=$(($curpos + 1))
+ fi
+ ;;
KEY_BACKSPACE)
if [ ${curpos} -gt 0 ]; then
input="${input%?}"
@@ -258,16 +268,20 @@ tui_show_prompt()
fi
;;
KEY_DEL)
+ if [ ${curpos} -lt ${#input} ]; then
+ : TODO
+ fi
;;
- # TODO: Line editing
KEY_SPACE)
if [ ${curpos} -lt ${len} ]; then
+ # TODO: Handle curpos not at end
input="${input} "
curpos=$(($curpos + 1))
fi
;;
*)
if [ ${curpos} -lt ${len} ]; then
+ # TODO: Handle curpos not at end
input="${input}${key}"
curpos=$(($curpos + 1))
fi