terminating command in IEX shell

418 views
Skip to first unread message

me.m...@gmail.com

unread,
Aug 12, 2014, 12:39:42 AM8/12/14
to elixir-l...@googlegroups.com
Is there any easier way to terminate a command which have been typed incorrectly. I'm not even talking about correcting the command. I just want the easy way to go to next line of IEX shell. for example, consider the following, when a partial copy paste, which was obviously invalid command. I could not convince IEX shell to go to line number 11 from line number 10. Any suggestions (other than restarting IEX shell, which I eventually did).

iex(10)> String.split
** (UndefinedFunctionError) undefined function: String.split/0
    (elixir) String.split()
iex(10)> ',15String.split("124
...(10)>
...(10)>
...(10)>
...(10)> end
...(10)> ;
...(10)> //df 
...(10)>
...(10)>
...(10)> ewew
...(10)> )
...(10)> )
...(10)> )
...(10)> )
...(10)> errete
...(10)> )
...(10)> ;
...(10)> .
...(10)> }
...(10)> }
...(10)> end
...(10)>  end
...(10)>


thanks,
miwi

Louis Simoneau

unread,
Aug 12, 2014, 1:35:25 AM8/12/14
to elixir-l...@googlegroups.com
In that particular case the first character of your invalid input was a single quote, so it opened a char list literal. A single quote would have closed that and resolved the expression, and dropped you back on the next line.

That being said, I’ve encountered this myself, and it would certainly be nice if ctrl-c cancelled the current input line, or something. But I don’t really now how iex is implemented or how dependent it is on the Erlang console, so not sure if that’s actually possible?

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

José Valim

unread,
Aug 12, 2014, 3:44:20 AM8/12/14
to elixir-l...@googlegroups.com
That being said, I’ve encountered this myself, and it would certainly be nice if ctrl-c cancelled the current input line, or something. But I don’t really now how iex is implemented or how dependent it is on the Erlang console, so not sure if that’s actually possible?

Yeah, I don't think it is possible right now but we do provide #iex:break, which you can type to break the current command. There is an example in the docs (last section):



me.m...@gmail.com

unread,
Aug 12, 2014, 5:21:55 AM8/12/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
#iex:break solves my issue. May be if we come across few more such points, they can be put in a document called "Elixir Gotchas".

thanks
miwi
Reply all
Reply to author
Forward
0 new messages