From 88dbe5d4d781a67c7de6732c56fa86ac22ac8c57 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Mon, 16 May 2022 23:47:21 -0400 Subject: predictor: backspace lastword --- predictor.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'predictor.sh') diff --git a/predictor.sh b/predictor.sh index 0ce7b44..ccbb21f 100755 --- a/predictor.sh +++ b/predictor.sh @@ -42,7 +42,8 @@ while read -r swipe; do rm -f "$lw" fi elif test "$swipe" = "$(echo -e "\x08")"; then - rm -f "$lw" + lastword="$(cat "$lw")" + printf %s "$lastword" | sed 's/.$//g' > "$lw" elif test "$swipe" = "$(echo -e "\n")"; then rm -f "$lw" else -- cgit 1.4.1