Skip to content
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

Windows users need OS-specific notes to get LFE up and running #44

Open
bcalco opened this issue Aug 11, 2020 · 2 comments
Open

Windows users need OS-specific notes to get LFE up and running #44

bcalco opened this issue Aug 11, 2020 · 2 comments
Milestone

Comments

@bcalco
Copy link

bcalco commented Aug 11, 2020

On Windows, rebar3 does not support rebar3 local install which would set up $HOME/.config/rebar3 automatically for them, for some reason. Each kind of shell one might run may have a different notion where $HOME is, making it necessary to add rebar.config with the necessary plugin additions in multiple places. In a DOS or PowerShell prompt, that location is C:\Users<username>.config\rebar3\rebar.config, and in MINGW and Cygwin, it's wherever $HOME aka ~/ is.

Alternatively, there is an environment variable one can set, REBAR_GLOBAL_CONFIG_DIR, and of course one would have to do this both via Windows' standard environment variable editor and in the ~/.bash_profile initialization script for each prompt. However, once the rebar.config file is set for each prompt, everything is peachy.

OK, one thing isn't peachy. For reasons that are being investigated, the rebar3 lfe repl task needs one extra step in order to actually render the REPL. (For this same soon-to-be grokked reasons, running the lfe script by itself crash-dumps.) In order to enjoy Lisping in a fully-functional LFE REPL, you will need to invoke lfe_shell:server(). from the Erlang Shell that appears instead of the LFE REPL when you issue the rebar3 lfe repl command. Apparently, when the initialization of the LFE REPL bombs in the context of the Erlang Shell, the Erlang Shell doesn't crash with it, and issuing lfe_shel:server(). work just fine.

One final gotcha: On the DOS prompt only, the ASCII art LFE coffee cup does not render properly. Looks great in MINGW and Cygwin, but DOS being DOS it looks more like a bowl of used ramen noodles. Users are however highly encouraged to give the new Windows Terminal application a try. It renders the LFE coffee cup beautifully whether you are firing up a standard command window or a PowerShell window. And everything works in the REPL as expected from that point on.

@bcalco bcalco changed the title Windows users may need OS-specific notes to get LFE up and running Windows users need OS-specific notes to get LFE up and running Aug 11, 2020
@jacksonbenete
Copy link

This lfe_shell:server(). was the step missing for me.

There is also good to note that might be no ASCII art at all, the change is very subtle from 1> prompt to lfe> and if you don't pay attention you might be repeating lfe_shell:server(). thinking it didn't worked since there is no ASCII art.

image

@gargakshit
Copy link

gargakshit commented Aug 27, 2021

Another way to get it running with proper readline, ASCII art is to use werl.exe as the ESCRIPT_EMULATOR. werl is shipped as a part of erlang on windows. You could do ESCRIPT_EMULATOR=werl rebar3 lfe repl in a git-bash shell or set ESCRIPT_EMULATOR environment variable with werl as the value assuming you have werl in PATH.

Result:

Result of the above stuff. It shows a LFE REPL using werl and rebar3

There is also good to note that might be no ASCII art at all

#70

Edit: formatting

@oubiwann oubiwann added this to the Backlog milestone Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants