I am launching an URxvt terminal from a startup script. When the terminal launches, I would like to work in a specific directory with a specific Python virtualenv loaded. These are the commands that accomplish this in an already running terminal:
$ cd myproject $ workon myvirtualenv Now, what is the command needed to launch this terminal? This is what I tried:
# called from startup script: /usr/bin/urxvt -e bash -ic 'cd myproject; workon myvirtualenv' This works, but that is hardly noticable because the terminal exits as soon as the two commands complete, which is almost immediately. I can prevent this from happening by calling bash again, like so:
# called from startup script: /usr/bin/urxvt -e bash -ic 'cd myproject; workon myvirtualenv; exec bash -i' But now the virtualenv isn't activated anymore in the second instance of bash, although the effect of the cd command does persist.
How can I spawn an URxvt terminal with an activated virtualenv?