Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Finding the first history event of the current instance
- X-seq: zsh-workers 35347
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Finding the first history event of the current instance
- Date: Sun, 31 May 2015 16:59:42 -0700
- In-reply-to: <12467.1433064564@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <87r3q7nzkr.fsf@gmail.com> <150529171657.ZM15077@torch.brasslantern.com> <150530154236.ZM17511@torch.brasslantern.com> <12467.1433064564@thecus.kiddle.eu>
On May 31, 11:29am, Oliver Kiddle wrote:
} Subject: Re: Finding the first history event of the current instance
}
} > 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.
That'd be fine by me, but read on.
} I'm not sure how the option parser works but that may
} change the meaning of fc + which isn't ideal.
I don't think it'll affect that at all. However, it will mean that
"fc +l" has the same meaning as "fc -l", unless we do a lot of special
processing. (Same for +r/-r etc.) So maybe we don't want that.
} 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.
What if someone loads (or reloads) history with "fc -R"? Ought those
be considered "new" in the current shell?
} Admittedly, this doesn't allow you to get a history entry matching a
} pattern from the old entries.
You can use -m with a range:
schaefer<502> fc -l -m echo\* 101 200
fc: no matching events found
schaefer<503> fc -l -m echo\* 201 300
250 echo $CPATH
Messages sorted by:
Reverse Date,
Date,
Thread,
Author