diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 07:55:48 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 07:55:48 +0000 |
commit | e7c1ed903389c9b1f4ec10f7ff1ac1370af1c914 (patch) | |
tree | 9d2fef6680d4d1718a15d78d17bcfc8644193065 /win32 | |
parent | 2e10eb8f666e0b2611f6267cab474ca2a12f3add (diff) | |
download | ruby-e7c1ed903389c9b1f4ec10f7ff1ac1370af1c914.tar.gz |
* win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
console supports it natively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/win32/win32.c b/win32/win32.c index 265e6d417e..ff314d380a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -7069,19 +7069,29 @@ rb_w32_write_console(uintptr_t strarg, int fd) 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); |