I'm trying get Spacemacs (i.e., Emacs) to use the Windows subsystem for Linux bash shell as the shell.

I've added (setq explicit-shell-file-name "c:/Windows/System32/bash.exe") to my .spacemacs configuration file, but when I enter:

SPC SPC ansi-term

and answer yes, it returns:

Spawning child process: invalid argument.

Is there a way to get Emacs to run bash (i.e., the Windows subsystem for Linux) as the shell?

  • I can't test it right now without getting to a Windows machine, but I strongly suspect the issue is that bash.exe is not actually the Bash shell, but the terminal emulator that Windows opens Bash inside of; Emacs can't open it for redirection because it isn't a program taking standard input and output. The first workaround that comes to me would be to enable sshd access into Bash on a high port (I use 2222) and use an ssh localhost:2222 command instead. If you're unsure how to do this, let me know and I'll dig up the relevant docs. – Trey Apr 9 '19 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.