rafi / tmux-pass

Quick password-store browser with preview using fzf in tmux.
17 stars 5 forks source link

PASSWORD_STORE_DIR changed dynamically is not taken into account #3

Open CaptainQuirk opened 3 years ago

CaptainQuirk commented 3 years ago

Hi !

I'm currently trying to have client related password stores and use direnv to achieve it in the shell (zsh). But if fails.

Environment

Prerequisites

export PASSWORD_STORE_DIR=<my-path>/.password-store

Steps to reproduce

You should see the passwords from the first folder

Current behavior

The passwords from the first folder are shown while $(pwd) corresponds to the second folder

Expected behavior

The passwords should be the ones of the second folder

Suggestion

This can be solved by adding eval "$(direnv export bash)" at the top of the plugin's scripts/main.sh file but I realize that it is quite specific. In any case, the existence of the direnv binary should be checked before doing anything.

Would a simple hook system be a solution ?

CaptainQuirk commented 3 years ago

Hi again !

Is it something you'd consider looking at ?

Thanks in advance !

CaptainQuirk commented 3 years ago

Hey @rafi ! Do you think you could spare some time looking at this :pray: ?

Thanks !

rafi commented 4 months ago

Hi, hope it's still relevant. I merged your PR, regardless, it all comes down to the key binding command, and the sub-shell it spawns. You could try re-mapping it yourself, e.g.:

tmux bind-key b run-shell "tmux split-window -l 10 \"eval \"$(direnv export bash)\" && /path/to/plugin/pass/scripts/main.sh '#{pane_id}'\""