Skip to content

Commit

Permalink
FIX: added missing X (columns) information of the console's `window-s…
Browse files Browse the repository at this point in the history
…ize on POSIX
  • Loading branch information
Oldes committed Nov 21, 2018
1 parent e33bb61 commit d443cb1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/os/posix/dev-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,18 @@ static void Close_Stdio(void)
*/ DEVICE_CMD Query_IO(REBREQ *req)
/*
** Resolve port information. Currently just size of console.
** Note: Windows console have BUFFER size, which may be bigger than
** visible window size. There seems to be nothing like it on POSIX,
** so the `buffer-size` info is reported same as `window-info`
**
***********************************************************************/
{
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
req->console.window_rows =
req->console.buffer_rows = w.ws_row;
req->console.window_cols = w.ws_col;
req->console.window_cols =
req->console.buffer_cols = w.ws_col;
return DR_DONE;
}

Expand Down

0 comments on commit d443cb1

Please sign in to comment.