diff --git a/cli/fish/config.fish b/cli/fish/config.fish index 312e7c8..910ac83 100644 --- a/cli/fish/config.fish +++ b/cli/fish/config.fish @@ -69,5 +69,21 @@ if status is-interactive # === auto cd into last activated directory test "$PWD" = "$HOME" && cd $last_pwd + + function readenv --on-variable PWD + if test -r .env + while read -l line + set -l line (string trim $line) + if [ -z "$line" ] + continue + end + if string match -q '#*' $line + continue + end + set -l kv (string split -m 1 = -- $line) + set -gx $kv + end < .env + end + end end