From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31590 invoked from network); 24 Nov 2020 12:53:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Nov 2020 12:53:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1606222381; b=Cu2B0FEQ5IOALsVpmZKDXA3KyOUGmjWqn8hsO/ec/KhLenteB2PQkaZkFIHl6z1caZB7oq4irQ 4lJRo6XzRUrlwW+cMbBFqZq577hNstcEEBKKgLKSHKo8xO37RMMCffNnzoj+v/YsQpAJNF2omo R++uEDhv4X0BSLxwmZm7tygAFhgMf6614wGSNcfefhbWewwRKyKpeA2eSpTXUtuD6jOp5k3rH8 3lgoWWd1rurFTja8EjKbyMa0ZWGC1yHoysvjX+fA5qVA9lJywJcIE+oFg84ssvF/zWP5Y9tYaS 2ttd3vnJDNGmkMvQ2Q7m1Kfe13Su6YKBvCNnvoKcNWAnsQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dmarc=none header.from=alumni.princeton.edu; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1606222381; bh=ki2nGH79ebxoPNLD59Vug8TXlrLHPbCAio8oAHZ1kgQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature; b=fghLrIWXYf4ov1kIDfONzm4Qfy2AnNJT1VqACFo4eo3QEY2M3+crClTCQHgsm3NJquFf+gM4zj JKhEPT84w0/XSgwYH40zVDI1wQfEkAJnuxeLLzss6eOB/r34KdOjFFTtsZLnS1Cpu/BIxuVITJ iXbKlsaems+1pZayJFmfo+d+n3hKwCyPjQIi0BuniI9U6vHahmMEjWGuxxSZu/PjYRRjQPDjtf 1T0V/ijuLspwRBxl/lqcc8aWr1uuHOiX4JJ3NU1Xvx99khj98s+6XBZfUEqPnCPApFgp1NNy0/ sa6FlQMofsELKSckMlfgrwmafvI37YO99vBjhckIfs5rag==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YubTApsoLidRHzq9iS5DxoEFvg8PuGkya103ymAPAQ8=; b=NCoRPtaeq2JOsnTslHz2HZp1oH ECrsmx0nIRmy9M/Sv3/esOIbZrIqFkTt66ii0ElXnQ9sY0VBIQZZqRhJa2791llq/dd+JjYbx/VK1 xBuKeU3RhjPwbxvXpLcDDRf9G52Pdn9r9oDbB0CtiSgkPDgsp8/XbXIk7JgmPuum0FVCrAZE7+4dF gsbdM3KVIW45NNcmKsiJdYoLSInNvUhvaT8b9+SPliWyOHo7WdR2NQGWBKdtL/8mYXj7vKTCEpoa9 UcWv1gfSLKpsahZ9pSxM2x6elcrYwz6knTa0Z3sfZilppqHzUoNaTMXQvm1nExClCv5l1VPSyUxZE qqoDDDXA==; Received: from authenticated user by zero.zsh.org with local id 1khXoY-000PXA-Id; Tue, 24 Nov 2020 12:52:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dmarc=none header.from=alumni.princeton.edu; arc=none Received: from mail-ej1-f47.google.com ([209.85.218.47]:42864) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1khXo3-000PAT-3e; Tue, 24 Nov 2020 12:52:27 +0000 Received: by mail-ej1-f47.google.com with SMTP id i19so28294801ejx.9 for ; Tue, 24 Nov 2020 04:52:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YubTApsoLidRHzq9iS5DxoEFvg8PuGkya103ymAPAQ8=; b=Cmnp011ncjo4qI8RkBZBF3DvRXhm2ugpu+YVMMqDa3Zr0WWGdQEZUIMAy2C+CMYksh RptvH+XOAfvfk0W6lXPS4OkJ9Agp42IHCSK/5D5MsLTr0BQJlkdSw6EKnahZo0YugDKt x9NRJZd5Hq7F3GIoamKcaQiTjwxQLFonMEBjlmn49GWhMoEPByhVkwkuPBH98KRZnOHo xb0782ce0z+mtDxH4CsQF/FFOi8lRn5G129PdPEc0GWXpAgYLTMLEYHaTfhws0UDD/W6 pUMVf6Y1NRe8TPozbpHWabXMznPIV9zOViSQkkxkQOvnX0eaN8mO1kYHai6WnHMIzEcY voYg== X-Gm-Message-State: AOAM531Ah8p/kkKFek3BIyayN3G+xew6nXaa0fFTZAigyoXBOOVI0Boh 3CYNCg7qgUuTWPQlBand6Y33w/yXCW36581SrCv+QR/B X-Google-Smtp-Source: ABdhPJwhnv56I5gMVKYw2bARM3Wi3YrYHwUNrp6sWa+IzVF1EGL6TEfquFcgWpjtDICOyBzBlwVyrjVH4iBS1PbywwI= X-Received: by 2002:a17:906:1e84:: with SMTP id e4mr3968615ejj.57.1606222346361; Tue, 24 Nov 2020 04:52:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Vin Shelton Date: Tue, 24 Nov 2020 07:50:23 -0500 Message-ID: Subject: Re: Date format in prompt To: Bart Schaefer Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000629fb505b4d9c82c" X-Seq: 26200 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --000000000000629fb505b4d9c82c Content-Type: text/plain; charset="UTF-8" Excellent! Thanks. I copied prompt_bart_setup and changed the appropriate line. In the spirit of being greedy and improving the UX, how would you parameterize this; how would you support US/normal/ISO date formats (looking at the comment) in the same function? Best, Vin On Sun, Nov 22, 2020 at 5:22 PM Bart Schaefer wrote: > On Sun, Nov 22, 2020 at 2:00 PM Vin Shelton > 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 > --000000000000629fb505b4d9c82c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Excellent!=C2=A0 Thanks.=C2=A0 I copied prom= pt_bart_setup and changed the appropriate line.

=
In the spirit of being greedy and improving the UX, how= would you parameterize this; how would you support US/normal/ISO date form= ats (looking at the comment) in the same function?

<= /div>
Best,
=C2=A0 Vin

<= div class=3D"gmail_quote">
On Sun, Nov= 22, 2020 at 5:22 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
On Sun, Nov 22, 2020 at 2:00 PM Vin Shelt= on <acs@al= umni.princeton.edu> 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.=C2=A0 I've grovelled through the source c= ode, but I can't figure out how to make the change.=C2=A0 Is there an e= asy way to do what I want?

It's this line in prompt_bart_ps1:

=C2=A0 =C2=A0 date=3D"%{$fg[%D]%}%D$rs"=C2=A0 =C2=A0 =C2=A0# Pref= er "%{$fg[%D]%}%W$rs" in the USA?

Just change to

=C2=A0 =C2=A0 date=3D"%{$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
--000000000000629fb505b4d9c82c--