From 6c6b5b4dcc06d7d299af239bf18ffeaac9c16dac Mon Sep 17 00:00:00 2001 From: CronyAkatsuki Date: Sun, 22 Oct 2023 11:34:46 +0200 Subject: [PATCH] Load python env if inside tmux session automatically Check if you are in a tmux session and if there is a .env directory. If there is activate the python environment --- .config/zsh/.zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index d9f1519..3eb05c5 100755 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -58,3 +58,8 @@ nnn_cd () } trap nnn_cd EXIT + +# Check if in tmux and if a venv directory exists activate the python environment +if [ ! -z "$TMUX" ] && [ -d "./env" ]; then + . ./env/bin/activate +fi