Patch #6210: implement ability to resize output device parameters to
fit terminal window size as it changes. Reviewed by John Darrington.
* automake.mk (src_ui_terminal_libui_a_SOURCES): Add new files.
* terminal.c: New file.
* terminal.h: New file.
* main.c (main): No need to set up SIGWINCH handler any longer.
But we do need to call terminal_init.
(set_fallback_viewport): Move to terminal.c.
[HAVE_LIBNCURSES] (get_termcap_viewport): Ditto.
[!HAVE_LIBNCURSES] (get_termcap_viewport): Ditto.
* read-line.c (readln_read): After the first line of a command,
call terminal_check_size to allow it to re-detect the terminal
size.
* ascii.c: Implement ability to resize output device parameters to
fit terminal window size as it changes.
(struct ascii_driver_ext): New members `auto_width',
`auto_length'.
(ascii_open_driver): Initialize new members, call
update_page_size.
(update_page_size): New function to update device size.
(handle_option): Support new "auto" setting for length, width.
(ascii_open_page): Call update_page_size.
* devices (tty-ascii): Set length and width to "auto", so that
they reflect the current size of the terminal window as it
changes.