Project

General

Profile

Bug #17639 ยป ENABLE_VIRTUAL_TERMINAL_PROCESSING.diff

YO4 (Yoshinao Muramatsu), 02/17/2021 04:04 PM

View differences:

ruby.c
DWORD m;
if (!GetConsoleMode(h, &m)) return 0;
# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x200
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x4
# endif
if (!(m & ENABLE_VIRTUAL_TERMINAL_PROCESSING)) return 0;
return 1;
win32/win32.c
DWORD m;
if (GetConsoleMode(h, &m)) {
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x200
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x4
#endif
SetConsoleMode(h, m | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
}
......
break;
}
reslen = 0;
if (dwMode & 4) { /* ENABLE_VIRTUAL_TERMINAL_PROCESSING */
if (dwMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) {
if (!WriteConsoleW(handle, ptr, len, &reslen, NULL))
reslen = (DWORD)-1L;
}
    (1-1/1)