Git Bash for Windows not working 'lein repl' command

两盒软妹~` 提交于 2019-12-12 21:54:01

问题


I'm actually using git bash instead of default windows command shell (cmd).
But I cannot run 'lein repl' in git bash.
It doesn't show anything and I must press crtl + c to regain control.

Any suggestion? Thank you.

-- EDIT

I'm running lein instead of lein.bat because I added alias lein=lein.bat in my .bashrc, so I don't think it is a problem.

lein run is working fine in Git Bash and leiningen works fine in windows cmd. The problem is explicity with lein repl.

When I run which lein I got which: no lein in ([MY-PATH-VAR])


回答1:


Using GitBash as your terminal, you can install the lein script rather than the lein.bat script.

The lein script will run correctly in GitBash (as it is effectively a Unix environment).

I recommend installing the lein script in a directory called bin in your user account directory, e.g.:

c:/Users/your-account/bin

Placing the lein script in bin will allow you to run the lein command anywhere on the GitBash command line.


A Note about Emacs, lein and windows

The lein script will also be called correctly from Emacs, assuming you run Emacs from the GitBash terminal, ie. runemacs. Add Emacs install directory to your user account PATH environment variable and GitBash will find it on the command line.

Emacs installed on Windows works better when run from the GitBash terminal, as you can then use ediff in Emacs, which requires the diff command that GitBash terminal provides.

My recommended Emacs installs for windows

  • zklhp emacs-w64 optomised
  • Chocolatey Emacs 64bit



回答2:


My experience was that lein repl (and I do use the lein bash script) would start up ok, also printing the startup messages of the lein command to the shell, but would then stop to output anything (although the process might be running fine), part. not providing an interactive prompt (except for the first), not echoing user input (except for the first), nor printing evaluation results. When terminating the process with Ctrl-C all my inputs would be passed to the underlying shell (with funny results like $ (+ 3 4) bash: +: command not found).

My solution is to use Git CMD for interactive commands like lein repl, lein figwheel etc., which (unfortunately, as it might seem) works fine. Running a Git sh process inside a different terminal emulation (Cmder) also gives me a working interactive environment.



来源:https://stackoverflow.com/questions/39761234/git-bash-for-windows-not-working-lein-repl-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!