Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: runtime/bin/stdio_win.cc

Issue 102123010: Add getter for hasTerminal, terminalColumns and terminalLines on stdout. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add include of thread.h and fix io_patch. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698