How can I make a function run every time cd successfully changes to another directory within sh on FreeBSD?
How can I make a function run every time cd successfully changes to another directory within sh on FreeBSD? I'm using sh as my shell on FreeBSD but I want to be able to have a pretty prompt like the one bash gives me on Ubuntu. There are two things that the FreeBSD implementation of sh seems to lack as far as PS1 escape characters go: The w works but does not expand $HOME to ~ , so this is something I have already hacked up myself w $HOME ~ I can use PS1 to update the prompt on the terminal, but as far as I can tell it is not possible to use the PS1 variable to update the title bar as well. ESC and BEL fail to set the title as one would expect if they were using bash or ksh ESC BEL Here is my .shrc file update_prompt() { case "$PWD" in "$HOME"*) pretty_pwd="~${PWD#*"${HOME}"}" ;; "/usr$HOME"*) pretty_pwd="~${PWD#*"/usr${HOME}"}" ;; *)...
