Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrium committed Dec 20, 2022
1 parent 22d1df4 commit 3ecfc44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kilo.c
Expand Up @@ -64,8 +64,9 @@ char editorReadKey() {
int getWindowSize(int *rows, int *cols) {
struct winsize ws;

if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
return -1;
if (1 || ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
if (write(STDOUT_FILENO, "\x1b[999C\x1b[999B", 12) != 12) return -1;
editorReadKey();
} else {
*cols = ws.ws_col;
*rows = ws.ws_row;
Expand Down

0 comments on commit 3ecfc44

Please sign in to comment.