do wrapping on screen swap
[k8sterm.git] / src / ttyresizeioctl.c
blob50ad3e5a99c9a9a74e5d9482c4b076a8d5aeff42
1 ////////////////////////////////////////////////////////////////////////////////
2 // tty resize ioctl
3 static void ttyresize (Term *term) {
4 if (term != NULL && term->cmdfd >= 0) {
5 struct winsize w;
6 //
7 w.ws_row = term->row;
8 w.ws_col = term->col;
9 w.ws_xpixel = w.ws_ypixel = 0;
10 if (ioctl(term->cmdfd, TIOCSWINSZ, &w) < 0) fprintf(stderr, "Warning: couldn't set window size: %s\n", SERRNO);
11 setWantRedraw(term, 1);