zsh-users
 help / color / mirror / code / Atom feed
* Time in prompt not shown, when %P used (promptinit)
@ 2015-10-29  8:09 Alexander Skwar
  2015-10-29 23:15 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Skwar @ 2015-10-29  8:09 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]

Hello

I'm using zsh 5.1.1-1ubuntu1 on Ubuntu 15.10. With the prompt command (from
promptinit), I set the prompt to "fire", which results in the following
prompt:

█▓▒░ask@ewzw032░▒▓██▓▒░ Don Okt 29
~/

Before Ubuntu 15.10, I had 14.04 and after the date ("Don Okt 29"), there
used to be the time. The time is now missing… :/

Variables:




PS1:
%B%F{yellow}%K{yellow}%{█▓▒░%}%B%F{white}%K{yellow}%n@%m%b%F{red}%K{yellow}%{░▒▓█%}%b%F{red}%K{black}%{█▓▒░%}%B%F{white}%K{black}
%D{%a %b %d} %D{%I:%M:%S%P}
%}%B%F{yellow}%K{black}%~/%b%f%k

PROMPT:
%B%F{yellow}%K{yellow}%{█▓▒░%}%B%F{white}%K{yellow}%n@%m%b%F{red}%K{yellow}%{░▒▓█%}%b%F{red}%K{black}%{█▓▒░%}%B%F{white}%K{black}
%D{%a %b %d} %D{%I:%M:%S%P}
%}%B%F{yellow}%K{black}%~/%b%f%k

RPOMPT:

(empty)



​The time should've been produced by: "
%D{%I:%M:%S%P}
​"

I noticed, that even a simple 'PROMPT=
%D{%I:%M:%S%P}
​
​
​$ ' doesn't show the time. But as soon as I remove the %P, it's working again.


I suppose, it somehow has to do with, that the time definition here in
Switzerland (German) is 24hours. There's no AM/PM.​


​I think, that this ​is in a sense a bug of zsh and/or promptinit, as
it doesn't check if the locale has am/pm.


Best ​Regards,​

Alexander
-- 
=>        *Google+* => http://plus.skwar.me         <==
=> *Chat* (Jabber/Google Talk) => a.skwar@gmail.com <==

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Time in prompt not shown, when %P used (promptinit)
  2015-10-29  8:09 Time in prompt not shown, when %P used (promptinit) Alexander Skwar
@ 2015-10-29 23:15 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2015-10-29 23:15 UTC (permalink / raw)
  To: Zsh Users

On Thu, Oct 29, 2015 at 1:09 AM, Alexander Skwar
<alexanders.mailinglists+nospam@gmail.com> wrote:
>
> I'm using zsh 5.1.1-1ubuntu1 on Ubuntu 15.10.
>
> Before Ubuntu 15.10, I had 14.04 and after the date ("Don Okt 29"), there
> used to be the time. The time is now missing

What version of zsh were you using on 14.04?

I suspect this is a problem introduced when time formatting was
changed to attempt to pass more of the format sequences directly
through to strftime().  We have had this sort of problem come up for
some other formats, depending on the strftime() implementation.

The %P string was always expected to be expanded by strftime and for a
long time (2004 - 2014) was simply ignored if it was empty (prior to
2004 it could cause a segfault).  I'm guessing that now it's being
incorrectly interpreted as an error and therefore aborting the entire
%D{...} replacement.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-29 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29  8:09 Time in prompt not shown, when %P used (promptinit) Alexander Skwar
2015-10-29 23:15 ` Bart Schaefer

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).