diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2025-05-05 14:50:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2025-05-05 14:50:38 -0300 |
commit | c5327b7577938d5f83fac6a4f9ebd3a5017ef8e7 (patch) | |
tree | bf394fe346ede5d0188a8844cd120bc1b3ae8327 /timew-shell | |
parent | 688634873c7008d2e48d6a93dfa01521a58193e9 (diff) | |
download | utils-organization-main.tar.gz utils-organization-main.tar.bz2 |
Adds history file support on timew-shellmain
Diffstat (limited to 'timew-shell')
-rwxr-xr-x | timew-shell | 9 |
1 files changed, 9 insertions, 0 deletions
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 |