summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdedit.c5
-rw-r--r--shell/cmdedit.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/cmdedit.c b/cmdedit.c
index 9c2facc..1690326 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -136,11 +136,14 @@ static void win_changed(int nsig)
struct winsize win = { 0, 0, 0, 0 };
static __sighandler_t previous_SIGWINCH_handler; /* for reset */
- /* emulate signal call if not called as a sig handler */
+ /* emulate signal call if not called as a sig handler */
if(nsig == -SIGWINCH || nsig == SIGWINCH) {
ioctl(0, TIOCGWINSZ, &win);
if (win.ws_col > 0) {
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
+ } else {
+ /* Default to 79 if their console doesn't want to share */
+ cmdedit_setwidth( 79, nsig == SIGWINCH );
}
}
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 9c2facc..1690326 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -136,11 +136,14 @@ static void win_changed(int nsig)
struct winsize win = { 0, 0, 0, 0 };
static __sighandler_t previous_SIGWINCH_handler; /* for reset */
- /* emulate signal call if not called as a sig handler */
+ /* emulate signal call if not called as a sig handler */
if(nsig == -SIGWINCH || nsig == SIGWINCH) {
ioctl(0, TIOCGWINSZ, &win);
if (win.ws_col > 0) {
cmdedit_setwidth( win.ws_col, nsig == SIGWINCH );
+ } else {
+ /* Default to 79 if their console doesn't want to share */
+ cmdedit_setwidth( 79, nsig == SIGWINCH );
}
}