2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-28 20:39:40 +00:00

Put a lower bound on autocons geometry

If some glitch happens during the read, do not end up with
absurdly low geometry.
This commit is contained in:
Jarrod Johnson 2021-03-18 15:48:25 -04:00
parent 79ef1c4811
commit 697b33ae80

View File

@ -120,6 +120,8 @@ int main(int argc, char* argv[]) {
ws.ws_col = 100;
ws.ws_row = 31;
}
if (ws.ws_col < 80) { ws.ws_col = 80; }
if (ws.ws_row < 24) { ws.ws_col = 24; }
ioctl(ttyf, TIOCSWINSZ, &ws);
tcsetattr(ttyf, TCSANOW, &tty);
ioctl(ttyf, TIOCCONS, 0);