Skip to content

direnv freezes while executing rbw when it has to start rbw-agent #358

Description

@devurandom

I use direnv with this .envrc on NixOS 26.05:

# shellcheck shell=bash
if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then
  source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
fi
use flake

source_env_if_exists .envrc.local

.envrc.local contains lines like:

export FOO_BAR="$(rbw get [REDACTED])"

When I run direnv allow for this directory and cd into it, rbw asks me for my vault password (using pinentry). After I enter it, the terminal freezes. Even Ctrl+C does not have any effect.

When I run rbw stop-agent in another terminal, the "direnv terminal" immediately unfreezes and returns to the shell prompt with output direnv: export [REDACTED]. The environment variables set in .envrc.local have non-empty values, i.e. rbw must have been able to retrieve the items from the vault.

Workaround: When I execute rbw-agent before entering the "direnv directory", rbw will also ask for the vault password, but the terminal will not freeze.

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