QUESTION :
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 " 33]0;${PWD} 07"'
#This will set to the directory name only (bin)
PROMPT_COMMAND='echo -ne " 33]0;${PWD##*/} 07"'
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.
ANSWER :
Strange. Maybe it has to do with when the pattern-expansion takes place in bash’s order of processing.
Something like `PROMPT_COMMAND=’BASED=${PWD##*/} echo -ne “