Saturday, 8 June 2013

Set the title for bash Terminal on mac OS X to current working directory

Set the title for bash Terminal on mac OS X to current working directory

I know they have been asking a lot of this question and I got it worked perfectly, but one thing I don't understand is why this is different.
 #This will show the full path (/usr/bin)
 PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"'


 #This will set to the directory name only (bin)
 PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007"'
The problem I have here is that I want to use the second one, but when I open a new tap it will go back to the default working directory, whereas the first one will keep the same working directory if I open another tap which I want that.

No comments:

Post a Comment