Uh oh!
There was an error while loading. Please reload this page.
Implement history command - #761
Conversation
Lists IRB input history with indices. Also aliased as `hist`.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
st0012
commented
Nov 29, 2023
@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 😉 |
garyhtou
commented
Nov 29, 2023
Oops, sorry for leaving this hanging. Thanks for the ping! I'll wrap this up later tonight :) |
Uh oh!
There was an error while loading. Please reload this page.
garyhtou
commented
Nov 30, 2023
It appears the CI failure might be unrelated |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
(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
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