Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Date format in prompt
- X-seq: zsh-users 26195
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Date format in prompt
- Date: Sun, 22 Nov 2020 14:22:42 -0800
- Archived-at: <https://zsh.org/users/26195>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-11/CAH%2Bw%3D7a6BMat%2BjGwAfmxowV%3DxGOUqG1rGUy-ZWo5GX%2BiyM9BdA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-ot1-f53.google.com) smtp.remote-ip=209.85.210.53; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0YcOpotOBSU+pPE5S5exeFquPU0N0Xq95iawY1WxmIs=; b=QgVxVt+drZfJC5jhUJa7TzvyMLh1ko5ZTv5e41dUfXnmz++yoTL6Yio4ismRN7oqIy iVrlZHbbUhQmvD6gf+3nrHVC7wKjDrMPSWeWhlYS2oQYWWMyoYwCgNS5d5V2EAagJ4x3 eusFyi+lUMj1evD2cQZfIqsIi5oXiIlvvw1e1/JCCQCGJt+2Dwnyc9HswilcyRGJwsGJ XDAeeMP0wuYndokwWFW/7lXuN0ZGMD0J79AfC90EIz2BBTf4cINLsRtXCiI42+v3CKaJ 8OWqoJ6oWM2YkDJqjFUDB8kTTTQOAoTUJ180Vn5QAj1DkMmLrSoY8XWvNMsQEUe3gH0m WOag==
- In-reply-to: <CACeGjnVOfjuNXwLeU4Ns7wkjB4BLNsFTT0QwxpjKbH3B=OyadQ@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <CACeGjnVOfjuNXwLeU4Ns7wkjB4BLNsFTT0QwxpjKbH3B=OyadQ@mail.gmail.com>
- Sender: zsh-users-request@xxxxxxx
On Sun, Nov 22, 2020 at 2:00 PM Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> I've used prompt bart for as long as I can remember.
Nice to know somebody else does. :-)
> But I'm an ISO date kind of guy, and I'd like to use %D{%Y-%m-%d} to get a four-digit year. I've grovelled through the source code, but I can't figure out how to make the change. Is there an easy way to do what I want?
It's this line in prompt_bart_ps1:
date="%{$fg[%D]%}%D$rs" # Prefer "%{$fg[%D]%}%W$rs" in the USA?
Just change to
date="%{$fg[%D]%}%D{%Y-%m-%d}$rs"
If changing in real time in an interactive shell (e.g. with zed -f),
you then have to re-run prompt_bart_ps1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author