Make rtop behavior match common consoles.
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
The <CR> behavior should match that of the Chrome console.
- When hitting
cr, it should submit whatever you have (even if it's invalid syntax), whileshift+crshould insert a newline (it's not clear this is possible, but it would be awesome). This would match the Chrome REPL and also Slack/Messenger! - Pasting multiple lines doesn't seem to work in
rtop(at least with iTerm). - It would be great if hitting
c-cwould cancel whatever command you're in the middle of editing, but it would also tell you "hit c-c again to exit". Right now, you have to typeexit 0;which is kind of annoying. - It would be good to print the errors using
BetterErrors. - Currently, I believe the REPL will accept any entry if it is a valid parse, when you hit
<CR>. That's bad if your cursor is in in the middle of a currently valid parse, but you want to insert a newline anyways (to add a new field etc). For example, your cursor is afterx, and you want to hit enter to insert a newline.
let something = {
field: x
};
- Note that it may be impossible to distinguish
shift+crfromcrin the terminal. However, the main important feature is that there's a way to distinguish between "submit what I have entered" vs. "I want to force a newline in the input".crto submit, andshift+crto force a newline would be ideal, but it may not be possible in the terminal. Instead, perhaps we usecrandctrl+crinstead?
In general, more people know how to use the Chrome REPL (of Slack for that matter) than any other REPL, so let's just match that (or are there any other popular REPLs that you know of that do a really great job?)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the rtop terminal input handling and reproduce the CR, multiline paste, and C-C cases described for iTerm. Trace how input is parsed and submitted, including the requested BetterErrors output. Done means the agreed submit/newline, paste, cancellation, and error-display behaviors are implemented and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100