Skip to content

Commit a9e9a99

Browse files
committed
Use buffer width and window height for screen size
1 parent 9f0defd commit a9e9a99

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clink/dll/getc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static int getc_internal(int* alt)
146146
GetConsoleScreenBufferInfo(handle_stdout, &csbi);
147147

148148
// Check for a new buffer size for simulated SIGWINCH signals.
149-
i = (csbi.dwSize.X << 16) | csbi.dwSize.Y;
149+
i = (csbi.dwSize.X << 16);
150+
i |= (csbi.srWindow.Bottom - csbi.srWindow.Top) + 1;
150151
if (!g_knownBufferSize || g_knownBufferSize != i)
151152
{
152153
if (g_knownBufferSize)

readline/compat/termcap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* SOFTWARE.
2020
*/
2121

22-
#define TERMCAP_DEBUG 0
22+
#define TERMCAP_DEBUG 0
2323

2424
#include <Windows.h>
2525

@@ -275,7 +275,7 @@ static void get_screen_size(int* width, int* height)
275275
if (GetConsoleScreenBufferInfo(handle, &csbi))
276276
{
277277
*width = csbi.dwSize.X;
278-
*height = csbi.dwSize.Y;
278+
*height = (csbi.srWindow.Bottom - csbi.srWindow.Top) + 1;
279279
return;
280280
}
281281
}

0 commit comments

Comments
 (0)