Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have sciprt that launches my development environment with multiple tmux tiles. I want to spawn a shell that sources my environment so I dont have to source it myself.

I usually do the following each time I open the tmux tile:

source env/bin/activate

I spawn my shell with $SHELL, I use zsh. I see that bash has the --init-file flag which sources a file, this also does not load the bashrc. I guess thats close but not good enough.

I am looking for something like this $SHELL --source ~/env/bin/activate. Or any workarounds also help


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
637 views
Welcome To Ask or Share your Answers For Others

1 Answer

I don't think this is possible; Your best bet is to implement a workaround in your own .zshenv file, e.g.,

if [[ test -e "$MY_INIT_SCRIPT_675" ]] ; then
 source "$MY_INIT_SCRIPT_675"
fi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...