-
Notifications
You must be signed in to change notification settings - Fork 3.4k
iex forgets bindings when interrupted #14032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just The infinite loop is important. If you're not actually interrupting anything with your interrupt, it won't happen, as you show above. I don't really know anything about how iex is put together at runtime, but you lose binds, imports, probably other environmental things. |
Oh, of course, the loop being required makes sense. Thank you! |
Yeah, I see why it works in Erlang, they automatically spawn a new process:
In Elixir, we decided that changing the process behind the scenes would be surprising behaviour. Things that you had set up, such as monitors, messages, or links, will either be broken or missing. So I am not sure we want to make this trade-off here too. :( |
I will close this for now, glad to reopen if people feel strongly and have good arguments, but I think the safest is to keep the evlauation tied to the process. Thanks for the report! |
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.1.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
Operating system
Linux 6.12.1_1 #1 SMP PREEMPT_DYNAMIC Sun Nov 24 23:14:58 UTC 2024 x86_64 GNU/Linux
Current behavior
iex forgets bindings when interrupted (via i from the ^G menu):
Expected behavior
I had assumed this would not happen, because it does not in erl:
This does not appear to be filed as an open or closed issue anywhere, so I am filing it now.
The text was updated successfully, but these errors were encountered: