a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Set `XDG_STATE_HOME`

Open bbb651 opened this issue 1 year ago • 3 comments

From the xdg basedir spec:

$XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or empty, a default equal to $HOME/.local/state should be used.

The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME. It may contain:

  • actions history (logs, history, recently used files, …)

  • current state of the application that can be reused on a restart (view, layout, open files, undo history, …)

I’m not entirely sure what it should be set to as I’m not familiar with iOS development, probably a folder inside ~/Library

This is needed for ani-cli

bbb651 avatar May 28 '24 15:05 bbb651

That's a good point. We already have XDG_CACHE_HOME, XDG_CONFIG_DIR and XDG_DATA_HOME, so it's easy to add XDG_STATE_HOME. I've set it to ~/Library, for now (it's also XDG_DATA_HOME).

holzschu avatar May 28 '24 20:05 holzschu

In the meantime, you can set XDG_STATE_HOME in your ~/Documents/.profile, this file is executed each time a-Shell opens a new window.

holzschu avatar May 28 '24 20:05 holzschu

By the way, I noticed a-shell is currently rendering with hterm in a webview, I'm in the beta for Ghostty (which has experimental support for iOS), I can ask mitchellh to let you join it if you're interested. Of course it's a massive undertaking and might not be worth it (I thought it wasn't maintained but I found out it was just moved to google's git forge). Anyways, I really appreciate all your work on a-shell and your dedication to helping people with their problems and use cases, it's really not taken for granted <3

bbb651 avatar May 30 '24 21:05 bbb651