Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Bash completions fail because XDG_DATA_DIRS is reset #496

Open
roberth opened this issue Feb 17, 2021 · 1 comment
Open

Bash completions fail because XDG_DATA_DIRS is reset #496

roberth opened this issue Feb 17, 2021 · 1 comment

Comments

@roberth
Copy link

roberth commented Feb 17, 2021

Describe the bug

Unlike nix-shell, lorri resets XDG_DATA_DIRS by default, causing user and system commands to fail to autocomplete.

To Reproduce
Steps to reproduce the behavior:

  1. use nixpkgs master
  2. use direnv with eval "$(lorri direnv)"
  3. observe that commands from the system or user profile do not support bash completion anymore

Expected behavior

Lorri preserves the host's XDG_DATA_DIRS by default, like nix-shell does.

Workaround

.envrc

HOST_XDG_DATA_DIRS="${XDG_DATA_DIRS:-}"
eval "$(lorri direnv)"
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${HOST_XDG_DATA_DIRS}"

Perhaps this logic can be built into lorri itself, although it'd be better to figure out why it's cleared in the first place.

Metadata

$ lorri info
lorri version: 1
Lorri Project Configuration

expression: /home/user/h/hercules-ci-agent/shell.nix
$ uname -a
Linux feb 5.9.16 #1-NixOS SMP Mon Dec 21 12:28:21 UTC 2020 x86_64 GNU/Linux

Additional context

stdenv extends XDG_DATA_DIRS as part of its setup.sh script.

@jamessewell
Copy link

I'm hitting this as well - workaround works, but would be nice to be built in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants