How-to: "Fix" IEx ctrl-D (exit) and ctrl-L (clear) with Autokey

Here’s my hack to get ctrl-d and ctrl-l working like one would expect in iex.

In Gnome Terminal, after starting iex, I can hit ctrl-l and it clears the screen and gives a new prompt just like other REPLs:

Screenshot%20from%202019-10-14%2021-40-04

I can hit ctrl-d and it immediately exits, like other REPLs:

Screenshot%20from%202019-10-14%2021-40-07

I added three configurations to Autokey to make this work:

That’s the config. Pretty easy. On Windows, AutoHotKey should work. Ubuntu users will have to do a little more work to get Autokey working because there’s no package maintainer for it.

PS: I’ve submitted an Erlang ticket to gauge interest in a real fix at its source.

7 Likes

How it works: I use Autokey to,

  • Replace ctrl-d with ctrl-\.
  • Replace ctrl-l with the clear command.
1 Like