Closed
Description
Description
This RFC proposes changing the default behavior in the REPL such that, when hitting the up/down arrow, an entire command is inserted, rather than just a line.
Currently, if you enter multi-line input
In [1]: function foo() {
// ...
};
In [2]: <|>
and hit the up arrow, you get
In [2]: };
This may be useful, but it is likely not what you want. Instead, you'd probably prefer to cycle through the entire command. In which case, when we press the UP arrow, we'd like to re-enter multi-line mode with the entirety of the previous command.
Note that currently we rely on built-in readline/REPL history behavior. In order to support this feature, we may need to maintain our own history record and capture key presses in order to efficiently cycle through entire previous commands.
Related Issues
- Reverse search is related: [RFC]: add reverse-search support in the REPL #2069
Questions
- Should this be configurable?
- Should we support a mode (e.g., via a modifier key) to allow single-line insertion, as currently supported?
Other
No.
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:
.
Metadata
Metadata
Assignees
Labels
Issue or pull request for enhancing existing functionality.Issue involves or relates to JavaScript.Needs further discussion.Issue or pull request specific to the project REPL.Request for comments. Feature requests and proposed changes.Likely to be challenging but manageable.Normal priority concern or feature request.