How do I use a shell in Emacs?
You can use an interactive subshell in Emacs by typing “M-x shell”. Emacs uses the SHELL configuration variable to determine which program to use as the shell. If you installed Emacs using the addpm.exe program, then addpm.exe will associate the value %COMSPEC% with SHELL in the registry. Emacs will then use the value of the COMSPEC environment variable when it starts up, unless the SHELL environment variable is explicitly defined (as when using the emacs.bat batch file). If you would like to specify a different shell for Emacs to use, then you should do one of two things. You should either explicitly set the environment variable SHELL to be the shell you want to use, or, if you want to have the COMSPEC environment variable determine the shell, then you need to install Emacs using the addpm.exe program and ensure that the SHELL environment variable is not defined when you start up Emacs. Note that sh-script.el does not recognize shell names when they have the ‘.exe’ extension on them.
You can use an interactive subshell in Emacs by typing “M-x shell”. Emacs uses the SHELL configuration variable to determine which program to use as the shell. If you installed Emacs using the addpm.exe program, then addpm.exe will associate the value %COMSPEC% with SHELL in the registry. Emacs will then use the value of the COMSPEC environment variable when it starts up, unless the SHELL environment variable is explicitly defined (as when using the emacs.bat batch file). If you would like to specify a different shell for Emacs to use, then you should do one of two things. You should either explicitly set the environment variable SHELL to be the shell you want to use, or, if you want to have the COMSPEC environment variable determine the shell, then you need to install Emacs using the addpm.exe program and ensure that the SHELL environment variable is not defined when you start up Emacs. Any replacement shell should follow Unix convention for the -c option, or else be invoked via cmdpr