zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Fix strftime (prompts) before 5.2?
Date: Sun, 22 Nov 2015 10:38:44 -0800	[thread overview]
Message-ID: <151122103844.ZM10439@torch.brasslantern.com> (raw)
In-Reply-To: <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)


      reply	other threads:[~2015-11-22 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22 17:27 Bart Schaefer
2015-11-22 17:43 ` PATCH: ztrftime: more workarounds for broken strftime interface Mikael Magnusson
2015-11-22 18:06 ` Fix strftime (prompts) before 5.2? Peter Stephenson
2015-11-22 18:38   ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151122103844.ZM10439@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).