Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Feature Request: fc -C to clear history and reset counter
- X-seq: zsh-workers 45845
- From: Markus Näher <markus.naeher@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Feature Request: fc -C to clear history and reset counter
- Date: Tue, 19 May 2020 17:52:14 +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
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi,
I'm planning to switch to zsh. There's one thing missing that currently
keeps me from finally leaving bash behind:
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.
With bash, I usually do
cd /path/to/my/project/; history -c; history -r project_bash_history
and I even set HISTFILE= to prevent writing to the history when I exit
the shell. Of course, I sometimes need to add desired commands to the
history file manually. That's what I mean by "curated history".
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. I've found
some hints to temporarily set HISTSIZE=0. Indeed, it empties the
history, but it does not reset the counter. So if the history had 137
entries, the new history will start at 138.
One advantage of my curated histories is that I know the numbers of my
most important entries. But they will get useless when they shift and
the amout is always different.
To me, a -C option in fc would be very helpful. Or maybe even -C -R to
clear and read in one call, but this would be bonus. :-)
Thanks and Regards,
Markus
Messages sorted by:
Reverse Date,
Date,
Thread,
Author