Skip to content

Commit d443cb1

Browse files
committed
FIX: added missing X (columns) information of the console's `window-size on POSIX
1 parent e33bb61 commit d443cb1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/os/posix/dev-stdio.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,18 @@ static void Close_Stdio(void)
266266
*/ DEVICE_CMD Query_IO(REBREQ *req)
267267
/*
268268
** Resolve port information. Currently just size of console.
269+
** Note: Windows console have BUFFER size, which may be bigger than
270+
** visible window size. There seems to be nothing like it on POSIX,
271+
** so the `buffer-size` info is reported same as `window-info`
269272
**
270273
***********************************************************************/
271274
{
272275
struct winsize w;
273276
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
274277
req->console.window_rows =
275278
req->console.buffer_rows = w.ws_row;
276-
req->console.window_cols = w.ws_col;
279+
req->console.window_cols =
280+
req->console.buffer_cols = w.ws_col;
277281
return DR_DONE;
278282
}
279283

0 commit comments

Comments
 (0)