holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.49k stars 112 forks source link

Set `XDG_STATE_HOME` #786

Open bbb651 opened 1 month ago

bbb651 commented 1 month ago

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

holzschu commented 1 month ago

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 commented 1 month ago

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.

bbb651 commented 1 month ago

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