summary refs log tree commit diff
path: root/bin/cash/var.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-21 17:17:52 -0500
committerJune McEnroe <june@causal.agency>2019-01-21 17:17:52 -0500
commit0c407935140531f4c6417faec8e7de3b2cccb619 (patch)
tree1ba03c015b78a9fb38b82d9d29213a7c0b6f3deb /bin/cash/var.c
parentRemove pingbot (diff)
downloadsrc-0c407935140531f4c6417faec8e7de3b2cccb619.tar.gz
src-0c407935140531f4c6417faec8e7de3b2cccb619.zip
Save cash history incrementally
Still needs better error and edge case handling, but seems to work.
Diffstat (limited to 'bin/cash/var.c')
-rw-r--r--bin/cash/var.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/cash/var.c b/bin/cash/var.c
index 26c39eb4..70e05385 100644
--- a/bin/cash/var.c
+++ b/bin/cash/var.c
@@ -108,10 +108,17 @@ struct localvar *localvars;
 int forcelocal;
 
 static const struct varinit varinit[] = {
-	{ &venv, 0, "ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/env.sh", NULL },
+	{
+		&venv, 0,
+		"ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/env.sh",
+		NULL,
+	},
 #ifndef NO_HISTORY
-	{ &vhistfile,	VUNSET,				"HISTFILE=",
-	  sethistfile },
+	{
+		&vhistfile, 0,
+		"HISTFILE=${XDG_DATA_HOME:-${HOME}/.local/share}/cash/history",
+		sethistfile,
+	},
 	{ &vhistsize,	VUNSET,				"HISTSIZE=",
 	  sethistsize },
 #endif