One of the problems I’ve had with various emacsen is the shell dirtrack support. This keeps the shell-mode’s idea of what directory you’re in in sync with which one you’re actually in. At least in Aquamacs, this support is not very good, and it will break if you use bash features like CDPATH or “cd -”.
My PS1 is:
'\u!\h:\w\$ '
So I wrote this regexp to match it. It should work on a normal Debian install, too.
(":\\(.*\\)[$#] " 1)
Hit M-x customize-variable RET dirtrack-list RET and paste that in.
There is a problem with this, which I solved.
Discussion