If the ioctl fails to tell us the winsize, default to 79.
-Erik
This commit is contained in:
parent
22332fd26f
commit
306f4fe480
@ -141,6 +141,9 @@ static void win_changed(int nsig)
|
|||||||
ioctl(0, TIOCGWINSZ, &win);
|
ioctl(0, TIOCGWINSZ, &win);
|
||||||
if (win.ws_col > 0) {
|
if (win.ws_col > 0) {
|
||||||
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
|
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
|
||||||
|
} else {
|
||||||
|
/* Default to 79 if their console doesn't want to share */
|
||||||
|
cmdedit_setwidth( 79, nsig == SIGWINCH );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,9 @@ static void win_changed(int nsig)
|
|||||||
ioctl(0, TIOCGWINSZ, &win);
|
ioctl(0, TIOCGWINSZ, &win);
|
||||||
if (win.ws_col > 0) {
|
if (win.ws_col > 0) {
|
||||||
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
|
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
|
||||||
|
} else {
|
||||||
|
/* Default to 79 if their console doesn't want to share */
|
||||||
|
cmdedit_setwidth( 79, nsig == SIGWINCH );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user