How do I open specific directories when I start iTerm2?

閲覧: 7,933 回
最初の未読メッセージにスキップ

Fischer, Daniel

未読、
2012/06/12 17:33:182012/06/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

未読、
2012/06/15 0:04:562012/06/15
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

未読、
2012/06/15 13:34:552012/06/15
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

未読、
2012/06/15 13:58:452012/06/15
To: iterm2-...@googlegroups.com
cd directory?

Aaron Meurer

George Nachman

未読、
2012/06/20 2:20:012012/06/20
To: iterm2-...@googlegroups.com
It's in prefs->profiles->general. Set working directory to "Directory:" and enter the path you want there.

lobatt

未読、
2014/11/05 10:05:172014/11/05
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

未読、
2015/03/24 1:40:472015/03/24
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,
全員に返信
投稿者に返信
転送
新着メール 0 件