Please help me make my terminal work!
April 4, 2008 10:24 PM
Subscribe
How can I get new tabs in Mac OS X Terminal.app to open with the same current working directory as the tab from which I opened the new one?
I use Mac OS X and Linux. Many Linux terminal emulators I've used (gnome-terminal,xfce-terminal) have this great feature where, when I open a new tab, the current working directory is set to the working directory of the shell I opened the new tab from. This is great when I'm working with my webapps - I cd into my project directory, start the server on one tab, open a new one to use for tests, open a third to use for editing. When I'm working on my homework for school I can open up one tab as my editing tab, another to use an interactive Python shell, another I can use to run my homework, etc etc.
As far as I can tell, there is no way to do this with Terminal.app or iTerm. iTerm's sourceforge page shows an outstanding request for this feature. I would add it in myself but I don't have any Objective-C skills :( Are there any other terminal apps for OS X that would allow me to do something like this?
Are there any good terminals for OS X/X11 that don't have too much in the way of dependencies/bloat that support this feature? I don't normally use X11 on my Mac, but am willing to for this awesome, time-saving feature.
posted by mebibyte to computers & internet (8 comments total)
2 users marked this as a favorite
Perhaps you could use the /usr/bin/osascript utility to tell Terminal to create a new tab in the current document of the window (or however it's referenced, this can get weird sometimes), and then issue the appropriate cd command to the new tab.
Use Script Editor.app to open the Terminal dictionary and peek around at what it supports, then have a look around MacScripter.net and its forums for examples of scripting Terminal.app.
posted by Mikey-San at 11:03 PM on April 4, 2008