Bug #9208
closedWin32 ANSI color no longer works since revision 43331
Description
In revision 43331 in file win32/win32.c function console_emulator_p was added, which supposedly checked for patched WriteConsoleW. However, since WriteConsoleW points to a stub (which does jmp [import]), the allocation base address is always 0x400000 (i.e. ruby.exe), which is never equal to kernel32.dll. Because of this colors on ruby trunk never work on Windows anymore.
Attached patch fixes the problem and still detects conemu (i.e. whether WriteConsoleW is patched or not).
P.S. I don't understand why ruby needs to detect conemu? Console attributes and colors work in conemu as is, i.e. console_emulator_p could just always return FALSE, and everything seems to work correctly. However when conemu is detected and ruby tries to output ansi codes colors actually don't work on my Win7 x64 for some weird reason. Seems like this emulator detection does more harm than good.
Files