about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-02-07 07:35:14 +0000
committerClint Adams <clint@users.sourceforge.net>2002-02-07 07:35:14 +0000
commit0eefb1ec2566bc1d3a6e341820ea1d139530d753 (patch)
tree8a4083a10b44889fb095c74793dd27042b227ea3
parent7dea9669bbdfe2b8cb239189e3b5e8b167e33b5a (diff)
downloadzsh-0eefb1ec2566bc1d3a6e341820ea1d139530d753.tar.gz
zsh-0eefb1ec2566bc1d3a6e341820ea1d139530d753.tar.xz
zsh-0eefb1ec2566bc1d3a6e341820ea1d139530d753.zip
unposted: Colin Walters's prompt, adapted for the theme system
-rw-r--r--ChangeLog6
-rw-r--r--Functions/Prompts/.distfiles1
-rw-r--r--Functions/Prompts/prompt_walters_setup25
3 files changed, 32 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0528b285f..46ec99313 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-07  Clint Adams  <clint@zsh.org>
+
+	* unposted: Functions/Prompts/.distfiles,
+	Functions/Prompts/prompt_walters_setup: Colin Walters's
+	prompt, adapted for the theme system.
+
 2002-02-06  Clint Adams  <clint@zsh.org>
 
 	* 16577: Src/hist.c: don't return a single dot as the
diff --git a/Functions/Prompts/.distfiles b/Functions/Prompts/.distfiles
index 7395260b6..758c28594 100644
--- a/Functions/Prompts/.distfiles
+++ b/Functions/Prompts/.distfiles
@@ -5,4 +5,5 @@ prompt_adam2_setup    prompt_fade_setup     prompt_suse_setup
 prompt_bart_setup     prompt_fire_setup     prompt_zefram_setup
 prompt_bigfade_setup  prompt_off_setup      promptinit
 prompt_elite2_setup   prompt_oliver_setup   prompt_clint_setup
+prompt_walters_setup
 '
diff --git a/Functions/Prompts/prompt_walters_setup b/Functions/Prompts/prompt_walters_setup
new file mode 100644
index 000000000..a0777f1bb
--- /dev/null
+++ b/Functions/Prompts/prompt_walters_setup
@@ -0,0 +1,25 @@
+prompt_walters_help () {
+  cat <<'EOF'
+This prompt is color-scheme-able.  You can invoke it thus:
+
+  prompt walters [<color1>]
+
+where the color is for the right-hand prompt.
+
+This prompt was stolen from Colin Walters <walters@debian.org>,
+who gives credit to Michel Daenzer <daenzer@debian.org>.
+EOF
+}
+
+prompt_walters_setup () {
+
+if [[ "$TERM" != "dumb" ]]; then
+    export PROMPT='%B%(?..[%?] )%b%n@%U%m%u> '
+    export RPROMPT="%{$fg_no_bold[${1:-green}]%}%~%{$reset_color%}"
+else
+    export PROMPT="%(?..[%?] )%n@%m:%~> "
+fi
+
+}
+
+prompt_walters_setup "$@"