Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Finding the first history event of the current instance



Bart wrote:
> } Or there's this patch.  I didn't add an option for listing only the

I know I've missed fc's ability to do this so that definitely looks
useful.

When it gets finalised, don't forget _fc.

> The options -N (new), -O (old), and -F (foreign) are all currently unused
> by "fc" if we wanted to add multiple filterings.

I think I'd favour +L for foreign (i.e. not local). It's easier to
remember that way. I'm not sure how the option parser works but that may
change the meaning of fc + which isn't ideal.

Rather than using the HIST_OLD or whatever flags, is it possible to
instead identify what the history number was when the shell started?

For new/old, one option would be to have a special token such as "-",
".", "^" or "0" that can be used to indicate the history number
when the shell started. It might need to be inclusive when used at the
start of the range and exclusive when used at the end so not exactly the
same as the number. So for example, this would be all old:
  fc -l 1 -
And this would be all new:
  fc -l -
Admittedly, this doesn't allow you to get a history entry matching a
pattern from the old entries.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author