This commit is contained in:
ca333
2017-10-09 11:45:49 +02:00
parent fcac670670
commit 9d36579649
42 changed files with 758 additions and 417 deletions

View File

@@ -14,7 +14,12 @@
#include <boost/thread.hpp>
#include <boost/thread/synchronized_value.hpp>
#include <string>
#ifdef _WIN32
#include <io.h>
#include <windows.h>
#else
#include <sys/ioctl.h>
#endif
#include <unistd.h>
void AtomicTimer::start()
@@ -406,11 +411,17 @@ void ThreadShowMetricsScreen()
// Get current window size
if (isTTY) {
struct winsize w;
w.ws_col = 0;
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1 && w.ws_col != 0) {
cols = w.ws_col;
}
#ifdef WIN32
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
cols = csbi.srWindow.Right - csbi.srWindow.Left + 1;
#else
struct winsize w;
w.ws_col = 0;
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1 && w.ws_col != 0) {
cols = w.ws_col;
}
#endif
}
if (isScreen) {