continue icon indicating copy to clipboard operation
continue copied to clipboard

Use XDG directory on Linux.

Open alula opened this issue 1 year ago • 8 comments

Description

Fixes #558.

I personally think that polluting the home directory with dotfiles is a pretty lazy and bad practice.

This PR currently only addresses said problem on Linux, by making Continue follow the XDG Base Directory specification.

This change is backwards compatible and only affects new setups, ~/.continue is still used if it already exists.

I didn't do anything about other platforms yet, Windows and macOS continues to use ~/.continue just like before.

Checklist

  • [x] The base branch of this PR is dev, rather than main
  • [x] The relevant docs, if any, have been updated or created

alula avatar Sep 13 '24 02:09 alula

On Windows, LOCALAPPDATA can be used to retrieve ~\AppData\Local, where app data is stored. Perhaps, u'd like to add it in your PR, otherwise I can file a PR once this is accepted.

I hate seeing dotfiles in my homefolder too

rimmer avatar Sep 13 '24 16:09 rimmer

Agreed, especially because it's constantly conflicting with .config's autocomplete. This is so infuriating.

ShayBox avatar Sep 18 '24 23:09 ShayBox

@alula your current code doesn't work per the spec. You're checking for XDG_DATA_DIR when you should be checking XDG_DATA_HOME

ChrisLane avatar Sep 19 '24 10:09 ChrisLane

@alula your current code doesn't work per the spec. You're checking for XDG_DATA_DIR when you should be checking XDG_DATA_HOME

Good catch, I have changed it from XDG_CONFIG_DIR last minute before commiting 😅

alula avatar Sep 19 '24 10:09 alula

An improvement to this would be to place config files in XDG_CONFIG_HOME.

Also, documentation should be updated to avoid people being confused when they can't find ~/.continue while having these environment variables set.

ChrisLane avatar Sep 19 '24 10:09 ChrisLane

Opening the config file via the plugin in Intellij seems to create/open files in ~/.continue/

ChrisLane avatar Sep 19 '24 11:09 ChrisLane

I've updated the IntelliJ plugin and other places too, now my question: how the former ~.continue/ directory present in maaaany places in the documentation be called from now?

alula avatar Sep 19 '24 11:09 alula

I skipped adding relevant logic to the Rust code as it seems to be broken and not used yet.

alula avatar Sep 19 '24 11:09 alula

Hey all, apologies for the late review here. After thinking about it for a bit, we're going to stick with ~/.continue, the primary reason being that we're often fighting not software bugs, but difficulties in making sure to guide users down the right path when they are customizing Continue. Moving the relevant files to a path that will vary per user is a real opportunity for confusion.

I appreciate the work that went into this though, so if there were interest in doing something like some easter egg flag that would have the directory stored instead at the XDG path that might be fine. Yes, it would still be complex, but I figure for the handful of users that care deeply about this that might be okay

sestinj avatar Oct 27 '24 07:10 sestinj

This PR contains some fixes that make CONTINUE_GLOBAL_DIR work correctly and removes few hardcoded paths. Should I open another one without the change that makes default directory different?

alula avatar Oct 27 '24 07:10 alula