Scrolling output in iex

Newbie here:

I have a simple application that starts with the Supervisor. It periodically IO.puts some diagnostic information.

Is it possible to run the application with “iex -S mix” and retain a windowed command line within iex so that I can see clearly what commands I am typing and yet see the diagnostic information scroll by above?

Right now anything I type will be interleaved with the program output. Any help would be most appreciated.

Can you please show the output here like what are you trying to run and what you getting ?

Bascially you can start you application with

iex -S mix

and run commands within the application context.

No, the feature you are asking for is currently not supported in iex, and will probably need to be supported in erl first, as iex is mostly just a shallow wrapper around it.

Noted, NobbZ. Thank you.

I think I made the classic error of not explaining my problem but instead diving into an attempted (imagined) solution.

What I am really looking for is a clean way to interact with an already running system using iex — changing state variables for example. Maybe this needs to be in a separate window from the text output of that system. I think I’ve seen demos of Elixir with people doing that.

Well, you can start one node that just dumps your logs, and connect a remote shell.

Or you dump your logs to a file, not doing IO based calls at all, but Logger only. Start with iex -S mix and enjoy the clean shell, have a second terminal that does tail -f on the logfile(s).


I didn’t know about nodes at all. Digging into it now, many thanks!

1 Like