summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]bash-git-prompt4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash-git-prompt b/bash-git-prompt
index 44bd8ea..8306481 100644..100755
--- a/bash-git-prompt
+++ b/bash-git-prompt
@@ -7,8 +7,8 @@ set -o pipefail
[ -z "$PS1Start" ] && [ -z "$PS1Ende" ] &&
if echo "$PS1" | grep -q "\S"
then
- PS1Ende="$(echo "$PS1" | sed "s|^.*[^\\]\(\\\\\?\S\s*\)\$|\1|")"
- PS1Start="$(echo "$PS1" | sed "s|\\\\\?\S\s*\$||")"
+ PS1Ende="$(echo "$PS1" | sed 's|^.*[^\]\(\\\?[$#>]\s*\([]\\[0-9m]\)*\s*\)$|\1|')"
+ PS1Start="$(echo "$PS1" | sed 's|\\\?[$#>]\s*\([]\\[0-9m]\)*\s*$||')"
else
PS1Ende=""
PS1Start="$PS1"