Skip to content

Multi-line REPL input #134

Open
@byorgey

Description

@byorgey

It would be nice if somehow you could enter expressions at the REPL using multiple lines. In theory, this should be easy, since the input form itself does not care whether it contains newline characters. The difficulty is how we distinguish between entering a newline and executing the contents of the REPL.

Originally, I thought to allow Enter at the REPL to type normal newlines, and use a special keystroke like Shift-Enter or Ctrl-Enter to execute it (like what Jupyter notebook does). However, Shift-Enter and Ctrl-Enter are problematic in the terminal; in most terminals they just send a regular Enter key event. This makes no sense whatsoever, but that's the way things are. =( One solution is to use a different special key (Ctrl-J? Ctrl-M?) for entering a newline; though that seems dangerous because it would be too easy to forget and hit Enter when you meant to add a new line. Or probably better would be to come up with some other special key to execute (accidentally entering a newline when you meant to execute is no big deal). It just might be annoying to always have to hit some other key combination every time you want to execute. Maybe it could be an opt-in feature.

Very open to other solutions as well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-Moderate EffortShould take a moderate amount of time to address.G-REPLAn issue having to do with the REPL.L-Language ServerIssues relating to the LSP implementation that talks to editors.S-Nice to haveThe bug fix or feature would be nice but doesn't currently have much negative impact.T-EditorsInvolves editor support.T-UIInvolves the user interface.Z-FeatureA new feature to be added to the game.Z-User ExperienceThis issue seeks to make the game more enjoyable to play.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions