zsh-workers
 help / color / mirror / code / Atom feed
* Feature Request: fc -C to clear history and reset counter
@ 2020-05-19 15:52 Markus Näher
  2020-05-19 18:28 ` Roman Perepelitsa
  2020-05-19 22:33 ` Bart Schaefer
  0 siblings, 2 replies; 15+ messages in thread
From: Markus Näher @ 2020-05-19 15:52 UTC (permalink / raw)
  To: zsh-workers

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-21  3:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 15:52 Feature Request: fc -C to clear history and reset counter Markus Näher
2020-05-19 18:28 ` Roman Perepelitsa
2020-05-19 20:22   ` Markus Näher
2020-05-19 22:58     ` Bart Schaefer
2020-05-20  0:13       ` Markus Näher
2020-05-20  0:23       ` Markus Näher
2020-05-19 23:03     ` Daniel Shahaf
2020-05-19 23:17       ` Bart Schaefer
2020-05-21  3:37       ` Daniel Shahaf
2020-05-19 22:33 ` Bart Schaefer
2020-05-20  0:13   ` Markus Näher
2020-05-20  4:15     ` Bart Schaefer
2020-05-20  9:38       ` Markus Näher
2020-05-21  1:05         ` Bart Schaefer
2020-05-20 23:53       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).