Merged
Conversation
Lists IRB input history with indices. Also aliased as `hist`.
tompng
reviewed
Nov 14, 2023
tompng
reviewed
Nov 14, 2023
Member
|
@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 😉 |
Contributor
Author
|
Oops, sorry for leaving this hanging. Thanks for the ping! I'll wrap this up later tonight :) |
garyhtou
commented
Nov 30, 2023
Contributor
Author
|
It appears the CI failure might be unrelated |
tompng
reviewed
Nov 30, 2023
tompng
reviewed
Nov 30, 2023
tompng
reviewed
Nov 30, 2023
tompng
reviewed
Nov 30, 2023
tompng
reviewed
Nov 30, 2023
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Dec 2, 2023
(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
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
historycommand (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 (
-gor-Goption); similar to thelscommand.Closes #751