Index: runtime/bin/stdio_win.cc |
diff --git a/runtime/bin/stdin_win.cc b/runtime/bin/stdio_win.cc |
similarity index 81% |
rename from runtime/bin/stdin_win.cc |
rename to runtime/bin/stdio_win.cc |
index 44e517de7a87d4440c80cb63dd06f14c77968a02..24ceb325cab4ca19dbbeea10c791d32d4c4bc69a 100644 |
--- a/runtime/bin/stdin_win.cc |
+++ b/runtime/bin/stdio_win.cc |
@@ -5,7 +5,7 @@ |
#include "platform/globals.h" |
#if defined(TARGET_OS_WINDOWS) |
-#include "bin/stdin.h" |
+#include "bin/stdio.h" |
namespace dart { |
@@ -64,6 +64,16 @@ void Stdin::SetLineMode(bool enabled) { |
SetConsoleMode(h, mode); |
} |
+ |
+bool Stdout::GetTerminalSize(int size[2]) { |
+ HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); |
+ CONSOLE_SCREEN_BUFFER_INFO info; |
+ if (!GetConsoleScreenBufferInfo(h, &info)) return false; |
+ size[0] = info.srWindow.Right - info.srWindow.Left + 1; |
+ size[1] = info.srWindow.Bottom - info.srWindow.Top + 1; |
+ return true; |
+} |
+ |
} // namespace bin |
} // namespace dart |