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

Bash completions fail because XDG_DATA_DIRS is reset #496

@roberth

Description

@roberth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions