From c5327b7577938d5f83fac6a4f9ebd3a5017ef8e7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 5 May 2025 14:50:38 -0300 Subject: Adds history file support on timew-shell --- timew-shell | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'timew-shell') diff --git a/timew-shell b/timew-shell index 2ebbf28..4e00273 100755 --- a/timew-shell +++ b/timew-shell @@ -3,6 +3,14 @@ # Timewarrior shell. # +# Parameters +TIMEW_HISTORY="$HOME/.timew_history" + +# Load history +if [ -e "$TIMEW_HISTORY" ]; then + history -r $TIMEW_HISTORY +fi + # Shell function timew_shell { local last_exit_code="0" @@ -10,6 +18,7 @@ function timew_shell { # While a "quit" command isn't entered, read STDIN while read -rep "$last_exit_code timew> " STDIN; do history -s "$STDIN" + history -a $TIMEW_HISTORY if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then break -- cgit v1.2.3