Repository navigation
Fix crash on tab completion when shell is not found - #16021
Merged
Merged
Conversation
This fix will let completion fail quietly instead of crashing the entire session when attempting to do completion where Erlang is not finding a valid shell. IEx.Server installs &IEx.Autocomplete.expand/1 as the expand_fun. expand/2 defaults its shell to :shell.whereis/0, which is specced pid() | undefined, and passes it to IEx.Broker.evaluator/1 explicitly - so evaluator/1's own default, shell/0, which maps :undefined to nil, never runs. Process.info/2 then raises ArgumentError in the group process and takes the session down, so Tab completion kills an IEx session whenever whereis has no shell to report: no user_drv, or a user_drv group without one, as on a node started with -noinput.
Member
|
💚 💙 💜 💛 ❤️ |
josevalim
pushed a commit
that referenced
this pull request
Oct 26, 2026
This fix will let completion fail quietly instead of crashing the entire session when attempting to do completion where Erlang is not finding a valid shell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix will let completion fail quietly instead of crashing the entire session when attempting to do completion where Erlang is not finding a valid shell. This was encountered on an SSH-based shell. An upstream improvement to make this find the shell that does exist is also hopefully possible. But Elixir probably shouldn't crash the shell for the sake of a completion.
IEx.Server installs &IEx.Autocomplete.expand/1 as the expand_fun. expand/2 defaults its shell to :shell.whereis/0, which is specced pid() | undefined, and passes it to IEx.Broker.evaluator/1 explicitly - so evaluator/1's own default, shell/0, which maps :undefined to nil, never runs. Process.info/2 then raises ArgumentError in the group process and takes the session down, so Tab completion kills an IEx session whenever whereis has no shell to report: no user_drv, or a user_drv group without one, as on a node started with -noinput.