panchog
user-switch-command fails to start an iex shell
Hello – Elixir newbee here.
Today I’ve learned about the user-switch-command (IEx — IEx v1.18.4), and doing an s iex fails with an error message mentioning set_unicode_state
On the same session, doing an s shell opens an additional Erlang shell, and it works without issue.
Here are all the details from my session (I am on macOS 15.5)
elixir
1.10.2-otp-22
1.18.4
*1.18.4-otp-28
erlang
*28.0.1
➜ iex
Erlang/OTP 28 [erts-16.0.1] [source] [64-bit] [smp:6:6] [ds:6:6:10] [async-threads:1]
Interactive Elixir (1.18.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> d = Date.utc_today
~D[2025-06-30]
iex(2)> d
~D[2025-06-30]
iex(3)>
User switch command (enter 'h' for help)
--> s
--> j
1 {iex,start,[[{dot_iex,nil},{on_eof,halt}],{elixir,start_cli,[]}]}
2* {shell,start,[]}
--> c
Eshell V16.0.1 (press Ctrl+G to abort, type help(). for help)
1> d.
d
2>
User switch command (enter 'h' for help)
--> c 1
iex(3)> d
~D[2025-06-30]
iex(4)>
User switch command (enter 'h' for help)
--> s iex
--> j
1 {iex,start,[[{dot_iex,nil},{on_eof,halt}],{elixir,start_cli,[]}]}
2 {shell,start,[]}
3* {iex,start,[]}
--> c
{unknown,{<0.66.0>,set_unicode_state,true}}
Interactive Elixir (1.18.4) - press Ctrl+C to exit (type h() ENTER for help)
*** ERROR: Shell process terminated! (^G to start new job) ***
14:06:11.669 [error] :gen_statem #PID<0.110.0> terminating
** (MatchError) no match of right hand side value: {#PID<0.66.0>, :set_unicode_state, true}
(kernel 10.3.1) group.erl:530: :group.handle_info/3
(stdlib 7.0.1) gen_statem.erl:3748: :gen_statem.loop_state_callback/11
(stdlib 7.0.1) proc_lib.erl:333: :proc_lib.init_p_do_apply/3
Process Label: {:group, {:iex, :start, []}}
Queue: [info: {#PID<0.66.0>, :set_unicode_state, true}]
Postponed: [info: {#PID<0.66.0>, :activate}]
State: {:server, {:state, :binary, #PID<0.66.0>, true, :none, false, #PID<0.111.0>, :cooked, [], true, &:edlin_expand.expand/2, true, {[], []}, [], :undefined}}
Callback mode: :state_functions, state_enter: false
14:06:11.677 [error] Process #PID<0.111.0> raised an exception
** (ErlangError) Erlang error: :terminated:
* 1st argument: the device has terminated
(stdlib 7.0.1) io.erl:202: :io.put_chars(:standard_io, ["Interactive Elixir (1.18.4) - press Ctrl+C to exit (type h() ENTER for help)", 10])
(iex 1.18.4) lib/iex/server.ex:86: IEx.Server.run_without_registration/3
User switch command (enter 'h' for help)
--> j
1 {iex,start,[[{dot_iex,nil},{on_eof,halt}],{elixir,start_cli,[]}]}
2 {shell,start,[]}
--> c 1
iex(4)>
User switch command (enter 'h' for help)
--> c 2
2> d.
d
3>
Popular in Questions
As a follow up to my earlier question:
I have the code compiling and running but not getting a successful login from the rest server. ...
New
I would like to know what is the best IDE for elixir development?
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Other popular topics
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
In Ruby, I can go:
User.find_by(email: "foobar@email.com").update(email: "hello@email.com")
How can I do something similar in Elixir? ...
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I'm writing a test for one of t...
New
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New







