far2l icon indicating copy to clipboard operation
far2l copied to clipboard

History files and other state data should be stored in ~/.local/state/far2l, not ~/.config/far2l

Open debushoukun opened this issue 1 year ago • 0 comments

According to the XDG base directory specification, state data such as action history is supposed to be stored in $XDG_STATE_HOME, which, by default, is equal to $HOME/.local/state:

$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, …)

This distinction is important if your configuration directory is stored on a cloud storage service or synchronised across devices through some other method, since history files are updated very frequently and you don't normally want them to be synchronised.

Edit: it's been pointed out to me in the Telegram chat that plugins/state.ini may need to be moved to the state directory as well.

Edit 2: it turns out that plugins/state.ini contains both plugin state data and plugin hot key settings; the former should be moved to the state directory, whereas the latter should stay in the config directory.

debushoukun avatar Feb 21 '24 13:02 debushoukun