Show path at the tab title and the cmdline prompt in mac terminal

Joined
Aug 3, 2010
Messages
10
Reaction score
0
Points
1
$echo $PS1
\u@\h:\w\$\[\e]0;\w\007\]


I have the above variable defined (in bash), which shows path in the tab title and the path, user, machine name in the command line prompt. However, when the path become longer than the terminal width, what I type after the prompt doesn't show properly. The same PS1 definition works fine in ubuntu gnome-terminal. Does anybody know how should I modify PS1 for mac terminal?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top