1

I tried to put this into the startup applications:

gnome-terminal --working-directory /media/Data/work/ -e '. .env/bin/activate'

where .env/bin/activate represents my virtualenv.

For some reason, it doesn't work; the terminal starts but displays a message

Failed to execute child process "." (Permission denied)

If I just start gnome-terminal manually, and then execute .env/bin/activate, everything works fine.

What am I doing wrong? (Running Ubuntu 14.04.)

0

1 Answer 1

2

Try this command instead:

gnome-terminal --working-directory /media/Data/work/ -x bash --rcfile .env/bin/activate

From man bash:

 The --rcfile file option will force bash to read and execute commands
 from file instead of /etc/bash.bashrc and ~/.bashrc.
4
  • That is a bit heavy-handed, isn't it? Ignoring .bashrc?
    – muru
    Mar 23, 2015 at 11:39
  • 1
    @muru This so far the only method I've found to keep 1. the terminal opened and 2. the virtual env activated. As ending the gnome-terminal command with an extra bash close/hide the venv. Mar 23, 2015 at 11:43
  • @Muru: It'll be up to the OP to decide whether the cure is worse then the disease... >:-) (I've upvoted as I wouldn't have found this)
    – Fabby
    Mar 29, 2015 at 21:54
  • couldn't the desease be cured by doing 'source /etc/bash.bashrc' and 'source ~./bashrc' in the custom rc-file ?
    – grenix
    Dec 2, 2022 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .