REPL: add an Option type to handle REPL options #23637
Merged
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.
It was previously not practical to disable the "align" feature
of backspace (#22939): overwriting the '\b' binding with:
'\b' => (s,o...) -> Base.LineEdit.edit_backspace(s, false)
worked to a certain extent, but for example it was disabling
the feature that '\b' must get you out of shell/help mode.
A new experimental Option type is introduced here, which is
meant to conveniently allow users to pass options controlling
the REPL behavior. For example:
Also the
Options
alternative is offered to setup theextra_repl_keymap
(andhascolor
), instead of using the less directsetup_interface
(but no more complicated though). Eventually, probably only one way should be supported. We could even have the following simplified API for simple but common needs:I didn't document this yet, until this is approved or becomes less experimental.
cc. @vtjnash who had asked me how to disable
backspace_align
.