From r_goertz at web.de  Mon Aug 28 09:33:31 2017
From: r_goertz at web.de (Ralf Goertz)
Date: Mon, 28 Aug 2017 09:33:31 +0200
Subject: [Rd] patch: automatically adjust width option when terminal is
	resized
Message-ID: <20170828093331.39607d5b@delligoertz.fritz.box>

Hi,

I guess there have been discussions about this in the past and from what
I understood hooking an R-function to facilitate automatic adjustment is
problematic. So why not doing it like this:

--- R-3.4.1/src/unix/sys-std.c  2017-03-24 00:03:59.000000000 +0100
+++ R-3.4.1/src/unix/sys-std.patched.c  2017-08-28 09:16:02.714204023 +0200
@@ -1005,6 +1005,9 @@
                // introduced in readline 4.0: only used for >= 6.3
 #ifdef HAVE_RL_RESIZE_TERMINAL
                rl_resize_terminal();
+               int rl_height, rl_width;
+               rl_get_screen_size(&rl_height,&rl_width);
+               R_SetOptionWidth(rl_width);
 #endif
             }
 #endif


I tried it out and it works perfectly here. Of course there should be
an option to switch this on and off but you get the idea. What do you
think?

Thanks,

Ralf



[Rd] patch: automatically adjust width option when terminal is resized
Ralf Goertz