mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-10 14:14:48 +02:00
Allow users to modify XDG_DATA_DIRS in the fish rc files
The only downside of this new technique is that it is no longer possible to set XDG_DATA_DIRS to an empty var in kitty.conf Since an empty XDG_DATA_DIRS breaks lots fo things, I dont think that is a big concern.
This commit is contained in:
@@ -65,15 +65,12 @@ def setup_fish_integration(env: Dict[str, str]) -> None:
|
||||
|
||||
def setup_fish_env(env: Dict[str, str]) -> None:
|
||||
val = env.get('XDG_DATA_DIRS')
|
||||
if val is None:
|
||||
env['KITTY_FISH_XDG_DATA_DIR'] = shell_integration_dir
|
||||
if not val:
|
||||
env['XDG_DATA_DIRS'] = shell_integration_dir
|
||||
elif not val:
|
||||
env['XDG_DATA_DIRS'] = shell_integration_dir
|
||||
env['KITTY_FISH_XDG_DATA_DIRS'] = ''
|
||||
else:
|
||||
dirs = list(filter(None, val.split(os.pathsep)))
|
||||
dirs.insert(0, shell_integration_dir)
|
||||
env['KITTY_FISH_XDG_DATA_DIRS'] = val
|
||||
env['XDG_DATA_DIRS'] = os.pathsep.join(dirs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user