summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-03-06 12:17:54 -0500
committerJune McEnroe <programble@gmail.com>2018-03-06 12:17:54 -0500
commitf79da4629aa9984b1245a9a774c10b724acc0dce (patch)
tree8922d681b4aa7fbc05e5f3f43e654bcb96a0486d
parentOnly sort system includes with \h (diff)
downloadsrc-f79da4629aa9984b1245a9a774c10b724acc0dce.tar.gz
src-f79da4629aa9984b1245a9a774c10b724acc0dce.zip
Trigger redraw on atch with 1x1 winsize
-rw-r--r--bin/dtch.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 8c174f82..6ce40b51 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -201,6 +201,13 @@ static int atch(int argc, char *argv[]) {
     error = ioctl(STDERR_FILENO, TIOCGWINSZ, &window);
     if (error) err(EX_IOERR, "ioctl(%d, TIOCGWINSZ)", STDERR_FILENO);
 
+    struct winsize redraw = window;
+    redraw.ws_row = 1;
+    redraw.ws_col = 1;
+
+    error = ioctl(pty, TIOCSWINSZ, &redraw);
+    if (error) err(EX_IOERR, "iotctl(%d, TIOCSWINSZ)", pty);
+
     error = ioctl(pty, TIOCSWINSZ, &window);
     if (error) err(EX_IOERR, "ioctl(%d, TIOCSWINSZ)", pty);
 
@@ -213,10 +220,6 @@ static int atch(int argc, char *argv[]) {
     error = tcsetattr(STDERR_FILENO, TCSADRAIN, &raw);
     if (error) err(EX_IOERR, "tcsetattr(%d)", STDERR_FILENO);
 
-    char c = CTRL('L');
-    ssize_t size = write(pty, &c, 1);
-    if (size < 0) err(EX_IOERR, "write(%d)", pty);
-
     char buf[4096];
     struct pollfd fds[2] = {
         { .fd = STDIN_FILENO, .events = POLLIN },
span>Štěpán Němec 2022-10-16Update to Linux man-mages 6.00Štěpán Němec 2022-10-16Update to NetBSD 9.3Štěpán Němec 2022-09-18Make copyrights and AUTHORS consistentJune McEnroe 2022-07-27Update to FreeBSD 13.1 2062.83June McEnroe 2022-07-27openbsd: Include man pages from baseXX.tgzKeith Whitney 2022-05-08Update to OpenBSD 7.1 2062.73June McEnroe 2021-10-15Update to OpenBSD 7.0 2062.63June McEnroe 2021-08-29Update to Linux man-pages 5.13 2062.53Štěpán Němec 2021-08-26Update to NetBSD 9.2 2062.52June McEnroe 2021-08-26Support DESTDIR in install/uninstallJune McEnroe 2021-08-26Add version number generatorJune McEnroe 2021-08-22Add ISC license headerJune McEnroe 2021-08-22Update to Linux man-pages 5.12Štěpán Němec 2021-06-21Add manuals for macOS 11.3June McEnroe 2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe