-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fix nested sessions' history saving #652
Merged
Merged
Conversation
This file contains 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
st0012
commented
Jul 20, 2023
@@ -154,13 +151,6 @@ def initialize(irb, workspace = nil, input_method = nil) | |||
|
|||
def save_history=(val) |
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.
I don't think we need to have this save_history
accessors on individual context objects, but it's better to keep them for compatibility.
st0012
changed the title
Simplify history saving activation
Simplify and fix nested sessions' history saving
Jul 31, 2023
st0012
force-pushed
the
refactor-history-saving
branch
2 times, most recently
from
August 4, 2023 16:55
81b629a
to
a04b3c4
Compare
st0012
force-pushed
the
refactor-history-saving
branch
from
August 4, 2023 17:15
a04b3c4
to
a711419
Compare
st0012
changed the title
Simplify and fix nested sessions' history saving
Fix nested sessions' history saving
Aug 4, 2023
1. Dynamically including `HistorySavingAbility` makes things unnecessarily complicated and should be avoided. 2. Because both `Reline` and `Readline` use a single `HISTORY` constant to store history data. When nesting IRB sessions, only the first IRB session should handle history loading and saving so we can avoid duplicating history. 3. History saving callback should NOT be stored in `IRB.conf` as it's recreated every time `IRB.setup` is called, which would happen when nesting IRB sessions.
st0012
force-pushed
the
refactor-history-saving
branch
from
August 4, 2023 17:46
a711419
to
5a9838a
Compare
tompng
approved these changes
Aug 9, 2023
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Aug 9, 2023
(ruby/irb#652) 1. Dynamically including `HistorySavingAbility` makes things unnecessarily complicated and should be avoided. 2. Because both `Reline` and `Readline` use a single `HISTORY` constant to store history data. When nesting IRB sessions, only the first IRB session should handle history loading and saving so we can avoid duplicating history. 3. History saving callback should NOT be stored in `IRB.conf` as it's recreated every time `IRB.setup` is called, which would happen when nesting IRB sessions. ruby/irb@0fef0ae160
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.
Fix nested IRB sessions' history saving:
HistorySavingAbility
makes things unnecessarily complicated and should be avoided.Reline
andReadline
use a singleHISTORY
constant to store history data. When nesting IRB sessions, only the first IRB session should handle history loading and saving so we can avoid duplicating history.IRB.conf
as it's recreated every timeIRB.setup
is called, which would happen when nesting IRB sessions.Fixes #666 #659