When using iex
, I sometimes create an incomplete expression by accident. A trivial example:
iex(1) String.reverse("foo"
...(1)
If I supplied the missing )
here, all would be well, but sometimes I don't see what I did wrong.
Is there a way to abandon the current expression - to say, "actually, forget that, just put me back on a working prompt?" Control + C
doesn't solve it; my options are to (a)bort
and kill the shell entirely, or (c)ontinue
and try to figure it out myself.
By contrast, Ruby's irb
will just forget the incomplete expression if I press Control + C
.
How can I recover from a mistake in the Elixir shell?