Skip to content

Consider honoring XDG_CONFIG_HOME on Windows (related to #3000) #3854

Description

@Cyrus580529

Opening this to ask before sending a PR, not sure it's wanted.

BatProjectDirs::new() (src/bin/bat/directories.rs) always uses etcetera's Windows strategy for the default config/cache dirs, which ignores XDG_CONFIG_HOME/XDG_CACHE_HOME even when they're set — that's what #3000 is hitting under MSYS2/Git Bash, where people often set XDG vars to keep dotfiles in one place. It's a compile-time choice in etcetera, not a bug in the crate.

bat already has BAT_CONFIG_DIR/BAT_CACHE_PATH as its own override for this exact situation. Would a PR that also checks XDG_CONFIG_HOME/XDG_CACHE_HOME on Windows before falling back to basedirs.config_dir()/cache_dir() be welcome? Same pattern, one more env var.

If not, I can just point #3000 at BAT_CONFIG_DIR and let it get closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions