# # # patch "unix/terminal.cc" # from [10809407b581afe8d412fb187e2e40f2e4c8d8ba] # to [a6ffc567a4a0bdc68cddacf21b43781ecf23fe28] # # patch "win32/terminal.cc" # from [1db5ba145a2e414e13d95c880c97a186efde869e] # to [abb89c53af9376bf93f6389f0bdd21adb315a3ff] # ============================================================ --- unix/terminal.cc 10809407b581afe8d412fb187e2e40f2e4c8d8ba +++ unix/terminal.cc a6ffc567a4a0bdc68cddacf21b43781ecf23fe28 @@ -24,6 +24,9 @@ bool have_smart_terminal() else term = ""; + // Emacs 22.2.1 on Windows sets TERM to "emacs", but on Debian Emacs sets + // TERM to "dumb". The fix is to set TERM in your ~/.emacs, not to mess + // with this logic. if (term == "" || term == "dumb" || !isatty(2)) return false; else ============================================================ --- win32/terminal.cc 1db5ba145a2e414e13d95c880c97a186efde869e +++ win32/terminal.cc abb89c53af9376bf93f6389f0bdd21adb315a3ff @@ -22,13 +22,19 @@ bool have_smart_terminal() else term = ""; - // Win32 consoles are weird; cmd.exe does not set TERM, but isatty returns - // true, Cygwin and MinGW MSYS shells set a TERM but isatty returns false. - // Let's just check for some obvious dumb terminals, and default to smart. - if (term == "" || term == "dumb") - return false; + // cmd.exe does not set TERM, but isatty returns true. Cygwin and MinGW + // MSYS shells set a TERM but isatty returns false. + if (isatty(2)) + { + return true; + } else - return true; + { + if (term == "" || term == "dumb") + return false; + else + return true; + } } unsigned int terminal_width()