How do I open specific directories when I start iTerm2?

7,933 views
Skip to first unread message

Fischer, Daniel

unread,
Jun 12, 2012, 5:33:18 PM6/12/12
to iterm2-...@googlegroups.com
Let's say I open up iTerm 2.

I'd like several tabs to open with several directories premarked with tab titles in place.

How would I do this?

George Nachman

unread,
Jun 15, 2012, 12:04:56 AM6/15/12
to iterm2-...@googlegroups.com
Set up various profiles, each with a different directory. Open a window with those profiles. Save the arrangement. Then you can restore that arrangement and recover the directories.

Fischer, Daniel

unread,
Jun 15, 2012, 1:34:55 PM6/15/12
to iterm2-...@googlegroups.com
How do I set a default directory in a profile? I see I can execute a command but not sure what to put there?

Thank you.

Aaron Meurer

unread,
Jun 15, 2012, 1:58:45 PM6/15/12
to iterm2-...@googlegroups.com
cd directory?

Aaron Meurer

George Nachman

unread,
Jun 20, 2012, 2:20:01 AM6/20/12
to iterm2-...@googlegroups.com
It's in prefs->profiles->general. Set working directory to "Directory:" and enter the path you want there.

lobatt

unread,
Nov 5, 2014, 10:05:17 AM11/5/14
to iterm2-...@googlegroups.com

I am setting up my default profile as below, but it always open home directory instead of the directory set in the Directory field, am I missing anything?

Paolo Giarrusso

unread,
Mar 24, 2015, 1:40:47 AM3/24/15
to iterm2-...@googlegroups.com


On Wednesday, November 5, 2014 at 4:05:17 PM UTC+1, lobatt wrote:

I am setting up my default profile as below, but it always open home directory instead of the directory set in the Directory field, am I missing anything?

I had the same problem. I fixed it by selecting, in the same preference pane you show, "login shell" instead of "Command: login -fp $MYUSERNAME" (in the screenshot, $MYUSERNAME is lobatt). Which seems a bug, since that command is a setting I got by default, somehow (like you, I guess), for whatever reason*. Hence, the "Working Directory" setting (henceforth WD) is broken out of the box. Moreover, it's *silently* broken: I don't see how WD should work if I have an arbitrary command (heck, who said it should be a shell), but then iTerm2 should *tell me* that the settings aren't compatible. iTerm2 could:
- give a validation error *telling* me that those two settings are incompatible. But that's not standard (except on web forms)
- disable WD when using custom commands. That's bad though, because how do I *discover* how to re-enable WD? Maybe WD should be moved to *under* the Login shell. Here's a mockup of the dialog in text form:

Command:
( ) Command: [........]
(x) Login shell
    Working Directory:
      ( ) Home directory
      ( ) ... /* Other WD options */

*I'm not on a fresh installation and I used iTerm before iTerm2, but that does not make the bug invalid.

Cheers,
Reply all
Reply to author
Forward
0 new messages