Don't use variables in the printf format string.
Add a color for current directory on PS1.
Extract window title from PS1 to a variable.