Catch SIGWINCH in interactive shells and call el_resize() to update

libedit's idea of the window size.
This commit is contained in:
Tim J. Robbins 2002-07-23 15:05:00 +00:00
parent dd4ac026f7
commit 9de7305e58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100578

View File

@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include "error.h"
#include "trap.h"
#include "mystring.h"
#include "myhistedit.h"
/*
@ -245,6 +246,12 @@ setsignal(int signo)
if (rootshell && mflag)
action = S_IGN;
break;
#endif
#ifndef NO_HISTORY
case SIGWINCH:
if (rootshell && iflag && el != NULL)
action = S_CATCH;
break;
#endif
}
}
@ -359,6 +366,11 @@ onsig(int signo)
! trap[signo][0] == '\0' &&
! (trap[signo][0] == ':' && trap[signo][1] == '\0'))
breakwaitcmd = 1;
#ifndef NO_HISTORY
if (signo == SIGWINCH)
el_resize(el);
#endif
}
@ -414,6 +426,9 @@ setinteractive(int on)
setsignal(SIGINT);
setsignal(SIGQUIT);
setsignal(SIGTERM);
#ifndef NO_HISTORY
setsignal(SIGWINCH);
#endif
is_interactive = on;
}