Zsh Mailing List Archive
Messages sorted by:
Re: Feature Request: fc -C to clear history and reset counter
- X-seq: zsh-workers 45859
- From: Markus Näher <markus.naeher@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Feature Request: fc -C to clear history and reset counter
- Date: Wed, 20 May 2020 02:13:45 +0200
- Autocrypt: addr=markus.naeher@xxxxxxx; keydata= mDMEXi1PPhYJKwYBBAHaRw8BAQdA5mC+PjCn5mz47ngBjY5+8r9YeloIjigNtKiHPaSlvAW0 JE1hcmt1cyBO5GhlciA8bWFya3VzLm5hZWhlckBnbXgubmV0PoiWBBMWCAA+FiEEVnCH2Hg5 cG3BryclHHm+zifSIesFAl4tTz4CGwMFCQlmAYAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQHHm+zifSIeuzrQEA1dCwtJCeDcc20kPViqt5ekqidR3gpW59obGT+xvt5pgBAMyawHqH pa+PH4Mr6+9Sh/6u/yI01WwvGAK/m2CJT6sOuDgEXi1PPhIKKwYBBAGXVQEFAQEHQO2mlMor hTTZq9WUdRZMc2NhGaapZ9ZyaQesF23tQGU7AwEIB4h+BBgWCAAmFiEEVnCH2Hg5cG3Brycl HHm+zifSIesFAl4tTz4CGwwFCQlmAYAACgkQHHm+zifSIes1TQEAs2SYqsBfB++PKJIFcZdh 2xkH5YBaSN5L8hepGnb8mhgBAKZqF4jEppwZt0/c92ymZu2EssLB2WIOx+V6LazlYMkF
- In-reply-to: <CAH+w=7Zd+LBozmiecm1i0MFBWtnV0pZ_tPxgUY-5VyRiAu9vAA@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <email@example.com> <CAH+w=7Zd+LBozmiecm1i0MFBWtnV0pZ_tPxgUY-5VyRiAu9vAA@mail.gmail.com>
On 20.05.20 00:33, Bart Schaefer wrote:
> On Tue, May 19, 2020 at 8:53 AM Markus Näher <markus.naeher@xxxxxxx> wrote:
>> 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
> 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.
I would not call any of these concepts superior to the other. Different
people just prefer different things.
I've read about the push/pop feature, but I'm more the "throw away the
old stuff and start over" kind of guy. I'll never need to pop. :-)
Can you give me some advice about the "appropriate extra arguments" you
wrote about ? My goal is to really start over, having nothing left from
the previous history.
Messages sorted by: