erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.39k stars 2.96k forks source link

ERL-1068: edlin: Improved bash-emacs UX #3918

Closed OTP-Maintainer closed 3 years ago

OTP-Maintainer commented 5 years ago

Original reporter: dogweather Affected version: OTP-19.1.1 Component: Not Specified Migrated from: https://bugs.erlang.org/browse/ERL-1068


As a user of erl, The Erlang Emulator, or iex, The Elixir Shell, my expectation is that it will act like other emacs-key shells and REPLs I've used. And it does for 99% of the functionality. However, there are two extremely common {{ctrl-}} keystrokes that edlin acts in a surprisingly different manner:

{{ctrl-d}}   Bash, and other prog langage REPLs will immediately exit when this is typed on an empty line. Erl/Iex, in contrast, appears to do nothing, and provides no feedback to the user. (When pressed in the middle of a line, edlin performs the same as bash et al, by deleting ahead.)

{{ctrl-l}}    Users have the expectation that this will clear the screen, and re-draw the prompt. In erl/iex, however, it appears to do nothing, and provides no user feedback.

Polyglot programmers would immensely benefit from either;

* Improving the emacs emulation to act like other similar apps for these two keystrokes, or
* Providing a configuration mechanism so that users can customize the keymapping.

I'd really like to contribute a PR for this work --- would the Erlang project be open to it?

See:  https://github.com/erlang/otp/blob/master/lib/stdlib/src/edlin.erl#L220 -- the hard-coded key mapping for {{ctrl-d}}
OTP-Maintainer commented 5 years ago

josevalim said:

Ctrl+D has already been proposed here: https://bugs.erlang.org/browse/ERL-331. There is also a link to a PR that was rejected with a proper rationale. It is probably best to continue the Ctrl+D discussion there.
OTP-Maintainer commented 5 years ago

lukas said:

yes, please continue the discussion in the existing ticket.