Emacs on Linux: preventing the Erlang shell buffer from echoing the prompt?

When making erlang-shell start erl or rebar3 shell prompts are echoed; e.g.:


1> 1.
1> 1.
1
2> 2.
2> 2.
2


The problem goes away with erl -oldshell, but I’d rather use rebar3 shell in order to leverage Rebar3’s features.

I’ve tried passing -oldshell to erl via the ERL_FLAGS env var, but then Rebar3 crashes.

Any suggestions? Thank you.


Environment:

  • Erlang/OTP v29.1.2 (includes erlang.el);
  • Rebar3 v3.27;
  • Emacs v30.2 (started as emacs -Q);
  • Linux Mint v21.1.

Configurations:

(setq inferior-erlang-machine "rebar3"
      inferior-erlang-machine-options '("shell"))
(setq inferior-erlang-machine "erl"
      inferior-erlang-machine-options '())
(setq inferior-erlang-machine "erl"
      inferior-erlang-machine-options '("-oldshell"))
(setenv "ERL_FLAGS" "-oldshell")

I’ve moved to using ghostel for terminals and running Erlang shells there. Pretty much all of the features you’d expect work.

Yes, switching to a more capable Emacs terminal emulator – Eat, in my case – fixed the echo issue for me as well.

However, my understanding – I’m new to Erlang – is that the Emacs support shipped with Erlang/OTP relies heavily on Comint, and switching to another terminal emulator means losing that integration (such as compilation and unit testing) and being left with a vanilla Erlang shell. Is indeed that the case?

Thank you.

We added stdlib config option shell_expand_location to reduce some of the shell-redrawing happening in the newshell, so maybe setting it to above can improve the situation a bit.

I’m sure rebar3 would appreciate a PR that fixes so that it works with oldshell.

Personally we use Makefile and build a dev release with reloader
enabled, so changed beam files are reloaded automatically.

I don’t use rebar3 much so don’t know what I’m missing there, if
anything.

elp + eglot + lsp for editing currently, makefile-runner finds the Makefile for
running make targets, etc.

I used to use erlang.el’s shell but moved to ghostel and haven’t looked back.

“Zaza” noreply@erlangforums.com writes:

Running a shell from Rebar3 makes all its commands available through the r3 module. As an Erlang newcomer, I can’t tell you what they would add to your current workflow.