Windows config paths & themes #2428
-
I'm having a lot of trouble on config with Windows (W11 Pro). One of the first issues I had is that bat doesn't seem to find my config file unless I specifically set "BAT_CONFIG_PATH". I have $HOME and all the $XDG vars set on my Windows system and most x-platform tools honor those variables when set on Windows. It would be a nice-to-have if it honored those vars, but it is resolved by setting "BAT_CONFIG_PATH". What is unresolved is everything else having to do with config paths. Nothing I do seems to change
I've copied the themes into both directories: C:\Users\simsrw73.config\bat && C:\Users\simsrw73\AppData\Roaming\bat
I would prefer bat to honor $XDG, so I can keep all my config in my home directory so I can manage it with chezmoi/git. Am I doing something wrong with my config to set locations? Am I doing something wrong to set the theme? My environment
❯ bat --diagnostics Software versionbat 0.22.1 (e5d9579) Operating systemWindows 6.2.9200 Command-lineC:\Users\simsrw73\scoop\apps\bat\current\bat.exe --diagnostics Environment variablesSHELL=<not set>
PAGER=moar
LESS=<not set>
LANG=<not set>
LC_ALL=<not set>
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=C:\Users\simsrw73\.config\bat\bat.conf
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=C:\Users\simsrw73\.config
XDG_CACHE_HOME=C:\Users\simsrw73\.cache
COLORTERM=<not set>
NO_COLOR=<not set>
MANPAGER=<not set> System Config fileCould not read contents of 'C:\ProgramData\bat\config': The system cannot find the path specified. (os error 3). Config file
Custom assets metadata
Custom assets
Compile time information
Less version
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It looks like bat/src/bin/bat/directories.rs Lines 31 to 32 in 5519f9c which doesn't seem to respect any of the As to why it says
I have no idea, if there are bat/src/assets/build_assets.rs Lines 55 to 60 in a3ea798 |
Beta Was this translation helpful? Give feedback.
It looks like
bat
is using a crate calleddirs_next
to get config directories:bat/src/bin/bat/directories.rs
Lines 31 to 32 in 5519f9c
which doesn't seem to respect any of the
XDG
env vars on Windows. I see thatbat
special cases MacOS, so maybe something similar can be done on Windows too, but the tricky part will presumably be to do so without breaking anyone's current setup.As to why it says
I have no idea, if there are
.tmTheme
files there when runningbat cache --build
because it looks l…