-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add flag to limit history --search
results
#3244
Comments
I find it hard to make an argument for search options for history when we provide I don't really see how this like the
I think this would need to be taking multiple seconds to empathize with. |
You wouldn't want to use Iterating is fine and that should be how people access history anyhow. The history command has been mostly useful for user-friendly deletion.
|
How would you get the timestamp; e.g., |
We don't currently expose the timestamp through the I suppose we could provide another magic array. So you'd want to have this array have the same entries it does now but also provide the timestamps. This seems nice: > echo $exthistory[-5]
make install fish #7/15/2015 4:45PM I was actually considering assembling just that after the fact just in |
You could handle the errors and stop the loop in the second example or use |
With PR 3399, coupled with the three previous changes to the history command, it's now possible to do something I've wanted since I started using fish a year ago:
Now I can type
|
While working on fixing other problems with the
history
command it occurred to me that there really should be a flag to limit the number of search results to the n most recent commands. I was used to having such a capability when I used zsh and wrote my own history wrapper function when I switched to fish in order to have a similar capability. This would be similar togit log -nnn
and far more efficient than piping the output ofhistory -search
throughhead -nnn
or directly iterating over$history
in a fish function.The text was updated successfully, but these errors were encountered: