Skip to content

Commit 68fe82b

Browse files
authored
Fix window resize bug after exiting to ksh from vim (re: f1c8ecc) (#865)
Reproducer (for a terminal with fullscreen support): $ <F11> # Maximize terminal to occupy entire screen $ vim # Open vim editor : <F11> # Unmaximize while in vim : q! # Quit vim $ /b<Tab><Tab> # Attempt to obtain completion list; triggers bug $ kill -WINCH $$ $ /b<Tab><Tab> # List works again after SIGWINCH edit.c: - Readd removed calls to sh_winsize() to fix the regression in the tab completion menu. The purpose of these is to obtain the correct window size in cases where ksh does not get sent SIGWINCH after the window size changes. Perhaps this is 'inefficient', but correct behavior is better (assuming such efficiency even matters that much in the editor modes).
1 parent cc5e069 commit 68fe82b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cmd/ksh93/edit/edit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ int tty_raw(int fd, int echomode)
246246
*/
247247
int ed_window(void)
248248
{
249-
int cols = sh.columns - 1;
249+
int cols;
250+
sh_winsize();
251+
cols = sh.columns - 1;
250252
if(cols < MINWINDOW)
251253
cols = MINWINDOW;
252254
else if(cols > MAXWINDOW)
@@ -624,6 +626,7 @@ int ed_read(void *context, int fd, char *buff, int size, int reedit)
624626
flush_notifybuf();
625627
goto skipwinch;
626628
}
629+
sh_winsize();
627630
ed_putchar(ep,'\r');
628631
/*
629632
* Try to move cursor to start of first line and pray it works... it's very

0 commit comments

Comments
 (0)