PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 30, 2022

[FIXED] How to quit after run IO.read(:stdio, :all) in the Elixir iex?

 October 30, 2022     elixir, elixir-iex, eof, io     No comments   

Issue

I need test some input data flow, and use 'IO.read', but after entering data i can't exit from this mode, CTRL-Z/X/C/D doesn't help (it terminates the whole iex). So how correct EOF command for this mode? Thanks!


Solution

TL;DR: Use ^G followed by j, i [nn] and c [nn].


In both erl and iex shells you always might ^G to enter a “User switch command” mode. Type h for help there.

iex|1 ▶ IO.read :stdio, :all

^G
User switch command
  --> j
    1* {erlang,apply,[#Fun<Elixir.IEx.CLI.1.96155272>,[]]}
  --> i 1
  --> c 1
{:error, :interrupted}

iex|2 ▶

Sidenote: the correct EOF termination would be ^D in all the terminals. I honestly have no idea why it does not work as expected in erl/iex consoles.



Answered By - Aleksei Matiushkin
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing