-
-
Notifications
You must be signed in to change notification settings - Fork 860
Closed
Labels
EnhancementIssue or pull request for enhancing existing functionality.Issue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.Needs DiscussionNeeds further discussion.Needs further discussion.REPLIssue or pull request specific to the project REPL.Issue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 3Likely to be challenging but manageable.Likely to be challenging but manageable.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
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
EnhancementIssue or pull request for enhancing existing functionality.Issue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.Needs DiscussionNeeds further discussion.Needs further discussion.REPLIssue or pull request specific to the project REPL.Issue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 3Likely to be challenging but manageable.Likely to be challenging but manageable.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.