Search code examples
emacscygwinmingwmsys

How to run emacs in CLI mode under mintty in windows?


I'm using mintty + msys. And I want to use emacs with it. But without GUI.
I saw such behavior in cygwin. But I can not understand how they did that.

$ emacs -nw
  emacs: standard input is not a tty

$ stty.exe -a
  speed 38400 baud; rows 24; columns 80; line = 0;
  intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
  eol2 = <undef>; swtch = ^Z; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
  werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
  -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
  -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
  -iuclc ixany imaxbel
  opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
  isig icanon iexten echo echoe echok -echonl -noflsh -tostop echoctl echoke

$ echo $TERM
  xterm

Solution

  • If you want to use tty emacs with mintty, you will probably need to use cygwin's emacs. The native win32 emacs wants to talk to a Windows console window, not to an actual tty -- the error message is misleading here.

    Another alternative, if you want to stick with the native win32 emacs, is to use ConEmu, rather than mintty. It gives a compatible Windows console interface while also providing all the niceties of a normal terminal emulator like mintty.