Skip to content

Use werl instead of erl when executing iex.bat #2174

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

Merged
merged 2 commits into from
Apr 16, 2014
Merged

Use werl instead of erl when executing iex.bat #2174

merged 2 commits into from
Apr 16, 2014

Conversation

bitwalker
Copy link
Contributor

This is more to start some discussion around this than necessarily the final solution for the problem. This commit sets an environment variable useWerl, which is then checked prior to executing erl in elixir.bat. If it is set to 1, werl is used instead of erl. This allows someone to override it and use erl for iex if they just want to use their native shell for iex (which still works, it's just missing some features like the CTRL+C and CTRL+G menus).

Thoughts?

@josevalim
Copy link
Member

@bitwalker unfortunately we cannot use environment variables because if you are inside iex and shell out to an elixir executable (don't ask me why you would do that), the varaible would be set and elixir won't work as expected. I think the best would be to check if +iex is given as argument (we arleady pass it from iex.bat) and then act accordingly. What do yu think?

@bitwalker
Copy link
Contributor Author

Ah that does make sense, hadn't considered that. I like your idea. I'll push an update for that shortly.

@josevalim
Copy link
Member

Btw, thanks for looking into this. I think that, if we change it to use werl, we can also change it to use the proper the smart shell. Theoretically we just need to pass the --erl "-user Elixir.IEx.CLI" (and guarantee it comes after -noshell in elixir.bat). As we do here:

https://github.com/elixir-lang/elixir/blob/master/bin/iex#L42

@bitwalker
Copy link
Contributor Author

I'll test that out as well while I'm in there

@bitwalker
Copy link
Contributor Author

@josevalim Ok, this actually works a lot better now with that last change. Let me know what you think.

@josevalim
Copy link
Member

This is a dream coming true! Thank you!

josevalim pushed a commit that referenced this pull request Apr 16, 2014
Use werl instead of erl when executing iex.bat
@josevalim josevalim merged commit e39b32f into elixir-lang:master Apr 16, 2014
@bitwalker bitwalker deleted the windows-shell-fixes branch April 16, 2014 18:02
@bitwalker
Copy link
Contributor Author

Thanks José!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants