diff options
| author | jason | 2021-04-07 13:05:33 -0600 |
|---|---|---|
| committer | jason | 2021-04-07 13:05:33 -0600 |
| commit | 54bf56fef53e179ad3fed210b4b0aebfcf994867 (patch) | |
| tree | bce6c4c2d301afb559754c162211d33d54b6c425 /bash | |
| parent | 8c4386df930569c2465ae6bf2fa6d8db3fb71a28 (diff) | |
| download | dotfiles-54bf56fef53e179ad3fed210b4b0aebfcf994867.tar.gz dotfiles-54bf56fef53e179ad3fed210b4b0aebfcf994867.zip | |
fix PS1 for direnv and virtualenv
Diffstat (limited to 'bash')
| -rw-r--r-- | bash/.bashrc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bash/.bashrc b/bash/.bashrc index 849f400..33a6160 100644 --- a/bash/.bashrc +++ b/bash/.bashrc | |||
| @@ -109,6 +109,13 @@ DIRENV=`which direnv` | |||
| 109 | if [[ -x $DIRENV ]]; then | 109 | if [[ -x $DIRENV ]]; then |
| 110 | eval "$(direnv hook bash)" | 110 | eval "$(direnv hook bash)" |
| 111 | fi | 111 | fi |
| 112 | show_virtual_env() { | ||
| 113 | if [[ -n "$VIRTUAL_ENV" && -n "$DIRENV_DIR" ]]; then | ||
| 114 | echo "($(basename $VIRTUAL_ENV))" | ||
| 115 | fi | ||
| 116 | } | ||
| 117 | export -f show_virtual_env | ||
| 118 | PS1='$(show_virtual_env)'$PS1 | ||
| 112 | 119 | ||
| 113 | # Enable warpdir (https://rc4.net/wd-rs/) | 120 | # Enable warpdir (https://rc4.net/wd-rs/) |
| 114 | WARPDIR=`which warpdir` | 121 | WARPDIR=`which warpdir` |