ruby-changes:41952
From: usa <ko1@a...>
Date: Tue, 8 Mar 2016 16:55:53 +0900 (JST)
Subject: [ruby-changes:41952] usa:r54026 (trunk): * win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
usa 2016-03-08 16:55:48 +0900 (Tue, 08 Mar 2016) New Revision: 54026 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54026 Log: * win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the console supports it natively. Modified files: trunk/ChangeLog trunk/win32/win32.c Index: win32/win32.c =================================================================== --- win32/win32.c (revision 54025) +++ win32/win32.c (revision 54026) @@ -7069,19 +7069,29 @@ rb_w32_write_console(uintptr_t strarg, i https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L7069 break; } reslen = 0; - while (len > 0) { - long curlen = constat_parse(handle, s, (next = ptr, &next), &len); - reslen += next - ptr; - if (curlen > 0) { - DWORD written; - if (!WriteConsoleW(handle, ptr, curlen, &written, NULL)) { - if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) - disable = TRUE; - reslen = (DWORD)-1L; - break; + if (dwMode & 4) { /* ENABLE_VIRTUAL_TERMINAL_PROCESSING */ + DWORD written; + if (!WriteConsoleW(handle, ptr, len, &written, NULL)) { + if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + disable = TRUE; + reslen = (DWORD)-1L; + } + } + else { + while (len > 0) { + long curlen = constat_parse(handle, s, (next = ptr, &next), &len); + reslen += next - ptr; + if (curlen > 0) { + DWORD written; + if (!WriteConsoleW(handle, ptr, curlen, &written, NULL)) { + if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + disable = TRUE; + reslen = (DWORD)-1L; + break; + } } + ptr = next; } - ptr = next; } RB_GC_GUARD(str); if (wbuffer) free(wbuffer); Index: ChangeLog =================================================================== --- ChangeLog (revision 54025) +++ ChangeLog (revision 54026) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Mar 8 16:54:29 2016 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the + console supports it natively. + Tue Mar 8 08:13:01 2016 Rei Odaira <Rei.Odaira@g...> * test/net/imap/test_imap.rb (test_idle_timeout): Because of the -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/