Skip to content

OTP 28: running erl on windows under git-bash results in error #10857

@Alexander-Taran

Description

@Alexander-Taran

Describe the bug
Zed editor on windows uses git bash as a shell for AI agent mode.
When it tries to run for example mix deps.get (Elixir land), erl crashes like in #9872

=ERROR REPORT==== 17-Mar-2026::13:15:53.658000 ===
** State machine user_drv terminating
** When server state  = {undefined,undefined}
** Reason for termination = error:{case_clause,
                                   {error,
                                    {'SetConsoleModeInitIn',
                                     'The handle is invalid.\r\n'}}}
** Callback modules = [user_drv]
** Callback mode = state_functions
** Stacktrace =
**  [{prim_tty,init_term,1,[{file,"prim_tty.erl"},{line,283}]},
     {user_drv,init,1,[{file,"user_drv.erl"},{line,186}]},
     {gen_statem,init_it,6,[{file,"gen_statem.erl"},{line,3316}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,333}]}]

To Reproduce
My guess is that it will plain crash under git bash on windows.
(I tested the scenario it does not crash when run directly under git bash, so the issue is more probably with redirecting IO streams)

It does crash in Zed agent panel with
"Run mix command" prompt
same as "run erl --version" command

Expected behavior
mix deps.get should not crash when ran by agent in zed (or simial conditions)

Affected versions
28

Additional Info
I worked around the issue downgrading OTP to v27.x

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions