aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtimew-shell9
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