How do I set a command on a profile so that when I start a new terminal window, it fires off that command.

Specifically, I'd like to be able to set my virtualenv with:

workon ENV

So that it starts automatically into my virtual environment when that I use that profile.


Profiles -> General -> Command


Everytime you open a new tab your bash profile will be sourced.

| improve this answer | |

Got it, there is an option added in the development branch of iTerm that adds a "Send text at start" option to the profile settings. This will eventually be added to a (more) stable version of iTerm.

| improve this answer | |
  • 1
    How to run multiple commands one after another in same profile tab? – Metal Gear Sep 5 '14 at 7:42
  • Can't seem to execute multiple commands either using iTerm2 - attempting to 'make configure', and then 'make service'. Any ideas appreciated! – zero_cool Oct 27 '15 at 17:15
  • You can separate commands with a ; and that will allow multiple commands on one line. In this example make configure; make service should work. – Nathan Black Oct 28 '15 at 21:20
  • Try command1 && command2 – Nitin Jadhav Feb 13 at 1:38

In iTerm2, preferences>profiles>tab general, there is an option in Command called send text at start that executes any command you put there after login.

In particular, I typically have

source ~/.virtualenvs/.../bin/activate

for profiles that use Python.

| improve this answer | |

Using the image to illustrate, please note the command selection and Send text at start: option.

enter image description here

| improve this answer | |

You must log in to answer this question.

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