Repository navigation
Conversation
Binding a key to a function name such as `exit` in inputrc called Kernel#exit with the key string and raised TypeError.
This branch has not been deployed
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.
Fixes #819
Control-d: exitin inputrc makeswrap_method_callfindKernel#exitthroughrespond_to?(method_symbol, true)and call it with the key string, which raisesTypeErrorand kills the session. OtherObject/Kernelmethods (abort,sleep,p,raise, ...) are reachable the same way.This is the small workaround mentioned in the issue:
wrap_method_callnow skips methods whose owner isObjector one of its ancestors, so such a binding is ignored like any unknown function name. Methods defined onReline::LineEditor(or a singleton alias, as intest_alias) still dispatch as before.Not covered: internal
LineEditormethods such asinitializeormove_historycan still be bound; that needs the explicit function registry discussed in the issue.Testing
test_ignore_method_inherited_from_objecttotest/reline/test_macro.rb; it fails on master withTypeErrorand passes with this change.bundle exec rake test: 409 tests, 0 failures, 0 errors (23 omissions).INPUTRCcontainingControl-d: exit: master crashes withTypeErroron Ctrl-D, with this change the key is ignored and input continues.