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.

Is there any way to open the new tab in the same directory as the existing tab ? I am running Console2 2.xx version over Windows7 platform.

I know that we can specify default directory. But it is same for all. I am expecting unix terminal like new tab functionality, when new tab is opened in the same directory as the parent tab (from which it is opened).

share|improve this question

migrated from stackoverflow.com Oct 5 '12 at 22:16

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

    
Try ConEmu? It has many advantages, for example you may start new tab from command line of existing one, for example vim -new_console:h –  Maximus Oct 6 '12 at 8:06

1 Answer 1

You can write $PWD to a file every command you run. When you launch a new tab, use bashrc to cd to that directory written in the file.

These lines in my bashrc does the trick for me.

PROMPT_COMMAND="$PROMPT_COMMAND echo \$PWD > /.pwd"
cd $(cat /.pwd)

It will mess up if you switch tabs and then launch a new tab. (Just remember to hit enter before you launch a new tab)

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.