Skip to content

Consider storing persistent history under XDG_STATE_HOME #2284

Description

@soiq1781-cell

Lem currently stores persistent history under (lem-home)/history,
which normally resolves to:

$XDG_CONFIG_HOME/lem/history

This means mutable application state is stored alongside user
configuration.

Persistent history such as recent files, command history, project
history, and REPL history seems to fit better under XDG_STATE_HOME,
for example:

$XDG_STATE_HOME/lem/history/

with the usual fallback:

~/.local/state/lem/history/

This also matters for declarative configuration managers such as
GNU Guix Home or Nix/Home Manager, where $XDG_CONFIG_HOME/lem
may be managed as an immutable/read-only directory.

Would it make sense for Lem to support a separate state directory,
perhaps something like lem-state-home, while keeping the existing
LEM_HOME behavior for backwards compatibility?

For example:

$XDG_CONFIG_HOME/lem/init.lisp
$XDG_STATE_HOME/lem/history/files
$XDG_STATE_HOME/lem/history/projects
$XDG_STATE_HOME/lem/history/commands
$XDG_STATE_HOME/lem/history/lisp-repl

I also noticed that some other mutable data, such as logs, is currently
stored relative to lem-home, but I'm keeping this issue specifically
about persistent history.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions