Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use Command + t to open an new tab in terminal, it always open my home directory.

How can I new a tab which open the same directory?

share|improve this question

migrated from stackoverflow.com May 20 '11 at 10:21

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Follow the steps as shown here : Open a new tab on Terminal with the same path

share|improve this answer

I would suggest you to use iTerm 2 and learn more about customizing it to your needs

enter image description here

share|improve this answer
    
It doesn't look like iTerm has a future, the most recent 0.x version will be two years old in september. iterm2.com perhaps? –  Daniel Beck May 20 '11 at 10:39
    
true, the screenshot is for iTerm2 :) –  balexandre May 20 '11 at 13:28

As of Mac OS X Lion 10.7, Terminal will do this by default if you're using bash as your shell (which is the default).

You can set preferences to decide whether to have new tabs and/or windows open at the same directory as the current terminal:

Terminal > Preferences > Startup > New windows/tabs open with > Same Working Directory

This works by having your shell (or other programs) send an escape sequence to tell Terminal the current working directory. The code to do this is in the system-wide bash configuration file /etc/bashrc.

If you're using zsh, I've adapted and expanded the code for /etc/zshrc in my answer to Resume Zsh-Terminal (OS X Lion).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.