Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Fix strftime (prompts) before 5.2?
- X-seq: zsh-workers 37194
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Fix strftime (prompts) before 5.2?
- Date: Sun, 22 Nov 2015 10:38:44 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=4YviNW+V1N9brJ6qE8Y3XhoIHLoyLYyAYJkSIezJ7EM=; b=EPQW5RRsF+NKrphuSfneeUaYDo6O9Qi6tVD4LSaevcBOawciGBh7CyGXvsJpO39uUk 7yCNdSwjiUqmVQtFETKzXBmYZ0qGOTkaM5AT377ZvChZRjxPsqDltqUY02cye2ssEu6s ETLn7Q0phWUy9aE1RGsK8b9O33akWN3kHIZeE35shjZ1hLtV3Vft392CxYff4GKlcLOK ecdeyjBiwi4RUgnxplC61hxg/wOIV1UyakLrAeNGZUzM0K8Xm6qMZ8nIDYE4MRiDkIbV VRYbYn1bJeWJTjq8oPR9yN/lYsc/xUcAb++5qUPJdtPzsxXCs+/t+ofmhUumN4vN23qT 69XQ==
- In-reply-to: <20151122180621.6aa84f81@ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <151122092711.ZM10012@torch.brasslantern.com> <20151122180621.6aa84f81@ntlworld.com>
On Nov 22, 6:06pm, Peter Stephenson wrote:
}
} Putting it all together, the reported failing case is:
}
} % (LC_ALL=de_CH.UTF-8; print -P "%D{%a %b %d} %D{%I:%M:%S%P}")
} Son Nov 22
Maybe it's time (ahem) for something like this? (Equivalent patch would
be needed in elite, elite2, fade, and fire themes.)
The difference is " %p" in most langinfo vs. "%P" in the current themes.
diff --git a/Functions/Prompts/prompt_bigfade_setup b/Functions/Prompts/prompt_bigfade_setup
index 2d95f31..918ac82 100644
--- a/Functions/Prompts/prompt_bigfade_setup
+++ b/Functions/Prompts/prompt_bigfade_setup
@@ -31,7 +31,10 @@ prompt_bigfade_setup () {
autoload -Uz prompt_special_chars
prompt_special_chars
- PS1="%B%F{$fadebar}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$userhost}%K{$fadebar}%n@%m%b%k%f%F{$fadebar}%K{black}$schars[260]$schars[261]$schars[262]$schars[333]%b%f%k%F{$fadebar}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$date}%K{black} %D{%a %b %d} %D{%I:%M:%S%P}$prompt_newline%B%F{$cwd}%K{black}%d>%b%f%k "
+ zmodload zsh/langinfo 2>/dev/null
+ local T_FMT=${${langinfo:+${langinfo[T_FMT_AMPM]}}:-%I:%M:%S%P}
+
+ PS1="%B%F{$fadebar}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$userhost}%K{$fadebar}%n@%m%b%k%f%F{$fadebar}%K{black}$schars[260]$schars[261]$schars[262]$schars[333]%b%f%k%F{$fadebar}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$date}%K{black} %D{%a %b %d} %D{$T_FMT}$prompt_newline%B%F{$cwd}%K{black}%d>%b%f%k "
PS2="%B%F{$fadebar}$schars[333]$schars[262]$schars[261]$schars[260]%b%F{$fadebar}%K{black}$schars[260]$schars[261]$schars[262]$schars[333]%F{$fadebar}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$fadebar}>%b%f%k "
prompt_opts=(cr subst percent)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author