Unified exit keybinding in REPL
Hanaasagi opened this issue · comments
Type exit
in REPL, we will see
Use exit() or Ctrl-D (i.e. EOF) to exit
This is a message from Python interpreter.
-
When compiled without
--features full-repl
,Ctrl-d
does not work. we need to useCtrl-c
to exit. -
When compiled with
--features full-repl
,Ctrl-c
has no effect, andCtrl-d
doesn't work either. We need to useCtrl-z
.
erg/crates/erg_common/stdin.rs
Lines 126 to 132 in 379caac
This inconsistent behavior is quite confusing.
At least, the REPL should be able to exit with Ctrl-D when built with --features full-repl
.
Without full-repl
, it should modify messages from Python.
At least, the REPL should be able to exit with Ctrl-D when built with --features full-repl.
Yes, I think so.
Without full-repl, it should modify messages from Python.
In a terminal environment, Ctrl-D tmeans EOF, indicating that the user has no more input. I tested the behavior of following REPL. I don't think the message needs to be modified. Using Ctrl-D to exit seems to be a convention.
key | python | node | ghci | irb |
ctrl-d | exit | exit | exit | exit |
Maybe support Ctrl + D/Z at the same time