11

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.

7

Profiles -> General -> Command

iterm-screenshot

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

4

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.

  • 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
3

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.

You must log in to answer this question.

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