-
Notifications
You must be signed in to change notification settings - Fork 119
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
Implement history
command
#761
Conversation
Lists IRB input history with indices. Also aliased as `hist`.
@garyhtou 👋 I think once you addressed these 2 feedback, we'll be very close to merging this PR and make it part of Ruby 3.3 😉 |
Oops, sorry for leaving this hanging. Thanks for the ping! I'll wrap this up later tonight :) |
It appears the CI failure might be unrelated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you 👍
(ruby/irb#761) * Implement `history` command Lists IRB input history with indices. Also aliased as `hist`. * Add tests for `history` command * Address feedback: `puts` with multiple arguments instead of `join`ing * Address feedback: Handle nil from splitting an empty input string * Refactor line truncation * Add `-g` grep option to `history` command * Add `history` command to README * Remove unused `*args` parameter * Allow spaces to be included in grep * Allow `/` to be included in grep regex * Handle `input` being an empty string * Exclude "#{index}: " from matching the grep regex * Add new line after joining ruby/irb@3f9eacbfa9
This PR adds the
history
command (aliased ashist
) which provides a list of previous IRB inputs. This supports multiline inputs but truncates them to two lines. Lines are displayed in reverse to show the most recent inputs first.This command also supports grep (
-g
or-G
option); similar to thels
command.Closes #751