PS-embedded comsub `\w' evaluation doesn't replace $HOME with ~
From:
Grisha Levit
Subject:
PS-embedded comsub `\w' evaluation doesn't replace $HOME with ~
Date:
Sun, 12 Mar 2017 16:46:36 -0400
For example:
$ PS1='\w $(echo \w) $ '
~ /home/levit $
Obviously, this is easy enough to work around in most cases by
replacing \w with ${PWD/#$HOME/~}. I had a silly application for
calculating prompt length and this was throwing it off, but this
behavior has been there since at least 2.05b so not sure if it's worth
changing..