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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13991 invoked from network); 19 May 2020 22:34:32 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 19 May 2020 22:34:32 -0000 Received: (qmail 27120 invoked by alias); 19 May 2020 22:34:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45852 Received: (qmail 1862 invoked by uid 1010); 19 May 2020 22:34:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi1-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25814. spamassassin: 3.4.4. Clear:RC:0(209.85.167.177):SA:0(-1.9/5.0):. Processed in 2.101043 secs); 19 May 2020 22:34:24 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.177 as permitted sender) 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:content-transfer-encoding; bh=VDZf8+L1sqlsuqwpQ5Y74EhrMR7Kq/UutPHPOMByzKw=; b=t9W5Df/72HWK0WyOMxRKzyNYDdel9xfYZbLaS8sy/AJlMjSa+h2LVhHkTBNi52NEky F0+hwBscruV1GVvVC6W/a9wt6EhDOhxitGpZ1v5Oib0r3PAXxX2wVYnv7L6mib7e8UmW y/yGnhCEkgBDCj4ahN6nJuNhQm1ABbJw7ZMqf1bS84uW0hFnNs93dF0b2pbbalqVawN9 5a42L/fN6AxgJoHtcfkffdg6kwXWNXxl92soXczMTYjEu+Op0jtyy4iBSh8aemHHZiRm hfusyqFQu+Q4dF13ch+SVdbOkL33tN485juMRdHc3DjaM9NNBCxKqFcrF2Kw1FiNwWOQ ZMNw== X-Gm-Message-State: AOAM533THTvNA+z7dSSVwniahzrx+u5n4ON/OPsrS3dKU7woX6DlwyJn Bn5neaGk8yFeF3QPfaQ0MJAqrnBRgXpp4oHUdSodTg== X-Google-Smtp-Source: ABdhPJxCYjPQGuj28nBmxDTZxMuVUwryGSQ0XvgzMFyydGW8Q01EKa6KqLyBFYhXUVzp2bmhxig1141aofJZ19rNoGs= X-Received: by 2002:a54:4601:: with SMTP id p1mr1219547oip.173.1589927628575; Tue, 19 May 2020 15:33:48 -0700 (PDT) MIME-Version: 1.0 References: <48e95c73-3a98-a4c2-7e0c-badf8544b4f2@gmx.net> In-Reply-To: <48e95c73-3a98-a4c2-7e0c-badf8544b4f2@gmx.net> From: Bart Schaefer Date: Tue, 19 May 2020 15:33:37 -0700 Message-ID: Subject: Re: Feature Request: fc -C to clear history and reset counter To: =?UTF-8?Q?Markus_N=C3=A4her?= Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 19, 2020 at 8:53 AM Markus N=C3=A4her w= rote: > > I'm using multiple individually curated histories for my projects. This > keeps the history short and clear. One history (my "default" history) is > for my non-project-related day-to-day tasks. > > I've learned that the corresponding zsh command is "fc". It has -R (and > -W), but it's missing -C for clearing the history completely. Zsh has what I think is potentially a superior mechanism: fc -p / fc -P to push and pop the history, respectively. fc -p creates a new empty history, resetting the counter fc -P discards the pushed history (if any) and restores the previous one So you can simulate bash's "history -c" by "fc -P;fc -p", with some appropriate extra arguments to manipulate history sizes and file locations. It should even work to do "fc -p" in your .zshrc file so that the "default" history is always empty and The initial read of the history file goes into a pushed history.