make LP_TITLE works under macos

This commit is contained in:
YoungKing 2013-04-29 00:10:08 +08:00
parent f483697fda
commit ccde12c406

View File

@ -1205,7 +1205,11 @@ _lp_load_color()
_lp_as_text()
{
# Remove colors from the computed prompt
local pst=$(echo $1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
case "$LP_OS" in
Linux|FreeBSD|SunOS) local pst=$(echo $1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") ;;
Darwin) local pst=$(echo $1 | sed -E "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") ;;
esac
# Remove escape sequences
# FIXME check the zsh compatibility