summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-06-28 20:19:04 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-06-28 20:19:04 -0700
commit7bc47c91e92cc6642e6dd416c4f94fb22bc6309c (patch)
treeaad764da21e42cb608bc55c3d97ffb8e0cf1bacf
parent6e57de8ee26bb106756246a455a5e610924eae62 (diff)
downloadzsh-7bc47c91e92cc6642e6dd416c4f94fb22bc6309c.tar.gz
zsh-7bc47c91e92cc6642e6dd416c4f94fb22bc6309c.tar.xz
zsh-7bc47c91e92cc6642e6dd416c4f94fb22bc6309c.zip
35660: prompt_adam1_setup: avoid perl, fix help
-rw-r--r--ChangeLog4
-rw-r--r--Functions/Prompts/prompt_adam1_setup7
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 850408986..c37b78ed9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-28  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 35660: Functions/Prompts/prompt_adam1_setup: avoid perl, fix help
+
 2015-06-29  Oliver Kiddle  <opk@zsh.org>
 
 	* 35637: Src/Zle/zle.h, Src/Zle/zle_main.c, Src/Zle/zle_tricky.c:
diff --git a/Functions/Prompts/prompt_adam1_setup b/Functions/Prompts/prompt_adam1_setup
index 034641fb8..aca0e59f1 100644
--- a/Functions/Prompts/prompt_adam1_setup
+++ b/Functions/Prompts/prompt_adam1_setup
@@ -14,8 +14,6 @@ This theme works best with a dark background.
 Recommended fonts for this theme: nexus or vga or similar.  If you
 don't have any of these, then specify the `plain' option to use 7-bit
 replacements for the 8-bit characters.
-
-And you probably thought adam1 was overkill.
 EOF
 }
 
@@ -27,8 +25,9 @@ prompt_adam1_setup () {
   base_prompt="%K{$prompt_adam1_color1}%n@%m%k "
   post_prompt="%b%f%k"
 
-  base_prompt_no_color=$(echo "$base_prompt" | perl -pe "s/%(K{.*?}|k)//g")
-  post_prompt_no_color=$(echo "$post_prompt" | perl -pe "s/%(K{.*?}|k)//g")
+  setopt localoptions extendedglob
+  base_prompt_no_color="${base_prompt//(%K{[^\\\}]#\}|%k)/}"
+  post_prompt_no_color="${post_prompt//(%K{[^\\\}]#\}|%k)/}"
 
   add-zsh-hook precmd prompt_adam1_precmd
 }