[PATCH] vi: allow manual screen update if SIGWINCH isn't supported

Denys Vlasenko vda.linux at googlemail.com
Sat Mar 30 17:03:08 UTC 2019


Applied, thanks.

On Wed, Mar 20, 2019 at 12:00 PM Ron Yorston <rmy at pobox.com> wrote:
>
> On platforms that don't support SIGWINCH vi can be configured
> with FEATURE_VI_USE_SIGNALS disabled and FEATURE_VI_WIN_RESIZE
> enabled.  This allows the user to force an update with ^L when
> the screen is resized.
>
> However, because the SIGWINCH handler hasn't run the virtual
> screen buffer won't have been updated and the display becomes
> corrupted.  Fix this by calling new_screen() if necessary.
>
> Signed-off-by: Ron Yorston <rmuy at pobox.com>
> ---
>  editors/vi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/editors/vi.c b/editors/vi.c
> index 065a1068e..eee36030e 100644
> --- a/editors/vi.c
> +++ b/editors/vi.c
> @@ -3348,7 +3348,15 @@ static void refresh(int full_screen)
>         if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) {
>                 unsigned c = columns, r = rows;
>                 query_screen_dimensions();
> +#if ENABLE_FEATURE_VI_USE_SIGNALS
>                 full_screen |= (c - columns) | (r - rows);
> +#else
> +               if (c != columns || r != rows) {
> +                       /* update screen memory since SIGWINCH won't have done it */
> +                       full_screen = TRUE;
> +                       new_screen(rows, columns);
> +               }
> +#endif
>         }
>         sync_cursor(dot, &crow, &ccol); // where cursor will be (on "dot")
>         tp = screenbegin;       // index into text[] of top line
> --
> 2.20.1
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list