aboutsummaryrefslogtreecommitdiffstats
path: root/commands/history.go
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2024-10-23 10:37:46 -0600
committerRobin Jarry <robin@jarry.cc>2024-10-24 22:13:51 +0200
commit1be64ef75100dd1ae4f246911e30cdb324db4f8a (patch)
tree8537da2b7e6c4c31069e3eb46d00dae8a28e11ad /commands/history.go
parentd0484b153aa5fa80c415f4025aef493eba167e12 (diff)
downloadaerc-1be64ef75100dd1ae4f246911e30cdb324db4f8a.tar.gz
history: read the history file from XDG_STATE_HOME
History is more like application state than a cache you would just want to blow away. Let's reflect that in the path for the history file. Changelog-changed: The location of the command history file has changed to ${XDG_STATE_HOME:-$HOME/.local/state}/aerc/history. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/history.go')
-rw-r--r--commands/history.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/history.go b/commands/history.go
index 0a7d6894..576c04b9 100644
--- a/commands/history.go
+++ b/commands/history.go
@@ -91,9 +91,9 @@ func (h *cmdHistory) initialize() {
var err error
openFlags := os.O_RDWR | os.O_EXCL
- histPath := xdg.CachePath("aerc", "history")
+ histPath := xdg.StatePath("aerc", "history")
if _, err := os.Stat(histPath); os.IsNotExist(err) {
- _ = os.MkdirAll(xdg.CachePath("aerc"), 0o700) // caught by OpenFile
+ _ = os.MkdirAll(xdg.StatePath("aerc"), 0o700) // caught by OpenFile
openFlags |= os.O_CREATE
}