racket / racket/drracket

[Feature request] Shift-enter in the REPL?

Open
#583 15 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

DrRacket currently uses submit-predicate to determine whether an "enter" should submit the expression for evaluation.

The issue with submit-predicate is its inflexibility. Sometimes we might want to enter multiple lines, but the first line is already deemed "terminating" by submit-predicate, so doing so is not possible. One possible workaround is to allow multiple lines by default and let users enter twice in a row to indicate submission, but that is also not ergonomic when users want to enter only one line.

But there is another model, seen in notebook applications (Jupyter) and messaging apps (like Slack, Facebook Messenger). There are two keys: shift-enter and enter. One submits the input unconditionally. One simply adds a newline without submitting the input. I find this to be more flexible, and the language creator doesn't need to concern with submit-predicate anymore.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing DrRacket's REPL input handling around the submit-predicate mentioned in the issue. Compare the existing Enter behavior with the proposed Shift-Enter and newline behavior; done means the interaction model is defined and implemented without requiring language creators to customize submit-predicate.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.