You’re right. I completely forgot about the case of connecting to a remote node.
I’m guessing the reason neither iex or erl doesn’t support just *gracefully exiting the repl* without killing any other processes because tty <https://www.erlang.org/doc/apps/erts/tty> doesn’t support it? Then how does this work with Ctrl+C? Additionally, Ctrl+D is typically the shortcut used to exit any shell (since it denotes EOF), not Ctrl+C. Most shells that support this probably inherited it from building on top of GNU readline or similar. I guess supporting this means patching edlin? <https://www.erlang.org/doc/apps/stdlib/edlin> Nevertheless, I think it’s a small, but important, quality of life improvement to support a quit/exit function and Ctrl+D our shell, since it doesn’t break the muscle memory of people coming from (or constantly switching back and fro) other languages. It’s a standard that everything from mainstream repls like python, irb and node, to more academic languages like Haskell and Coq and even lisps (which have heavy remote repl usage) like clojure, common lisp and scheme adhere to. Maybe it’s worth revisiting this after the necessary changes are made upstream? – bp * From*: =?UTF-8?Q?Jos=C3=A9_Valim?= <[email protected]> * Subject*: Re: [elixir-core:12150] iex: q() shorthand for :init.stop() * To*: [email protected] * Date*: Fri, 16 Jan 2026 12:52:47 +0100 Thank you for the proposal. We didn't add this on purpose. Ctrl+C is the correct way to stop a remote shell. If you run `q()` on a remote node, it will stop the remote node, bringing production down. If that's what you want, type System.stop. :) *José Valimhttps://dashbit.co/ <https://dashbit.co/>* On Fri, Jan 16, 2026 at 12:21 PM Benjamin Philip < [email protected]> wrote: > Hi, > > Currently the common way to exit iex is C-c C-c (Ctrl + c Ctrl + c). erl > on the otherhand supports the q() helper, short for init:stop(): > > Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] > [async-threads:1] [jit:ns] > Eshell V16.0.2 (press Ctrl+G to abort, type help(). for help) > 1> q(). > ok > 2> % > > It would be great if we could introduce the same helper to iex. > > – bp > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/elixir-lang-core/CAMEXYWerue9T_inV-fmmxx4Kpi%3Dj-pFAC9yXujbu3SS7HXaNfA%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAMEXYWerue9T_inV-fmmxx4Kpi%3Dj-pFAC9yXujbu3SS7HXaNfA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J9SyPZjLS8wS-4Tr%3DCG85s1pZ7mMZz3RQTwxLcx7xKtA%40mail.gmail.com <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J9SyPZjLS8wS-4Tr%3DCG85s1pZ7mMZz3RQTwxLcx7xKtA%40mail.gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/CAMEXYWcQ7_c5mfgdAouYadj2j8jtUf6Ep%2BYoL%2BWpAkWe9S1c1w%40mail.gmail.com.
