kurtlawrence / papyrus

(Rust) repl
MIT License
440 stars 14 forks source link

Control+D should terminate papyrus; maybe Control+C shouldn't #103

Open ctrlcctrlv opened 3 years ago

ctrlcctrlv commented 3 years ago

Python's REPL interprets Control+C as a way to stop a run-away REPL command. It immediately breaks with the exception KeyboardInterrupt (which Python programs can indeed handle, but that's another story).

If done at the REPL, Python just prints "KeyboardInterrupt" and the REPL remains open.

You don't have to copy Python exactly, but most REPL's do quit on Control+D (EOF), as this allows scripts to use them, and also, since it's a frequent standard, users expect it.

Can Papyrus follow suit?

jaskij commented 2 years ago

This is also common in shells - Ctrl+D for exit. Current behavior of Papyrus is confusing.