From ccde12c406cbba07df09992aa6cf1110ed3ab8fd Mon Sep 17 00:00:00 2001 From: YoungKing Date: Mon, 29 Apr 2013 00:10:08 +0800 Subject: [PATCH] make LP_TITLE works under macos --- liquidprompt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 1ce6e72..d07cc81 100755 --- a/liquidprompt +++ b/liquidprompt @@ -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