9 days ago

The Interactive Elixir (IEX) console is a powerful tool for Elixir developers, serving as a read-eval-print loop (REPL) to test code snippets, debug, and experiment with Elixir’s features in real time. While launching IEX is straightforward (via the iex command in your terminal), exiting it can be less intuitive—especially if you’re accustomed to using Ctrl-C to terminate processes in other shells.Many users assume Ctrl-C works to exit IEX, but this often leads to confusion: pressing Ctrl-C in IEX triggers a “break” menu rather than a direct exit. In this blog, we’ll demystify exiting IEX by exploring command-based alternatives to Ctrl-C, including the recommended exit() function, alternative commands, and best practices for cleanly closing the shell.

Tags: