Metrics UI: Fall back to 80 cols if GetConsoleScreenBufferInfo() fails
This commit is contained in:
parent
bce692390f
commit
831b6af932
|
@ -478,8 +478,9 @@ void ThreadShowMetricsScreen()
|
||||||
if (isTTY) {
|
if (isTTY) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) != 0) {
|
||||||
cols = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
cols = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
struct winsize w;
|
struct winsize w;
|
||||||
w.ws_col = 0;
|
w.ws_col = 0;
|
||||||
|
|
Loading…
Reference in New Issue