On my Windows XP machine I use Emacs-25.2.1. During web app development I use ConEmu version 191012 and I need to use Emacs at the command line. When I enter emacs -nw on ConEmu, it says

emacs: standard input is not a tty

This error occurs on MSYS2's default terminal Mintty which is invoked by cmd.exe /A /Q /K C:\msys32\mingw32_shell.bat, too but it doesn't occur on Windows' default CMD.exe and PowerShell so I guess it may have something to do with the Environment Variables. Several months ago, the ConEmu had a problem where the arrow keys and backspace were not working, (roughly described here) and I remember fixing it by changing or deleting an environment variable. This standard input is not a tty problem seemed to pop up roughly around the same after I fixed that problem but I'm not 100% sure of this.

What should I do to fix this problem?


It was the erroneous startup script of ConEmu named Bash::Msys2-32 which was confusing the emacs -nw It was (the erroneous one)

set CHERE_INVOKING=1 & set "PATH=%ConEmuDrive%\msys32\usr\bin;%PATH%" 
& %ConEmuBaseDirShort%\conemu-msys2-32.exe 
-new_console:p %ConEmuDrive%\msys32\usr\bin\bash.exe
 --login -i 

It should have been like (the correct one)

set CHERE_INVOKING=1 & %ConEmuDrive%\msys32\usr\bin\bash.exe 
--login -i -new_console:C:"%ConEmuDrive%\msys32\msys2.ico" 
-new_console:d:"C:\Documents and Settings\lenovo" 

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.