How to set an iTerm2 startup command
-
29-09-2020 - |
Question
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.
Solution 2
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.
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange