File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
colorize/source/redub/libs/colorize Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ void cwrite(S...)(File f, S args)
4747 {
4848 WinTermEmulation winterm;
4949 winterm.initialize();
50+ if (winterm.supportVT100)
51+ {
52+ f.write(s);
53+ return ;
54+ }
55+
5056 foreach (dchar c ; s)
5157 {
5258 auto charAction = winterm.feed(c);
Original file line number Diff line number Diff line change @@ -19,12 +19,17 @@ version(Windows)
1919 struct WinTermEmulation
2020 {
2121 public :
22- @nogc void initialize() nothrow
22+ bool supportVT100; // if true, that whole emulation is useless.
23+
24+ void initialize () nothrow
2325 {
2426 // saves console attributes
2527 _console = GetStdHandle(STD_OUTPUT_HANDLE );
2628 _savedInitialColor = (0 != GetConsoleScreenBufferInfo(_console, &consoleInfo));
2729 _state = State.initial;
30+ uint mode;
31+ if (GetConsoleMode(_console, &mode))
32+ supportVT100 = (mode & ENABLE_VIRTUAL_TERMINAL_INPUT ) != 0 ;
2833 }
2934
3035 @nogc ~this () nothrow
You can’t perform that action at this time.
0 commit comments