summary refs log tree commit diff
path: root/curtis
diff options
context:
space:
mode:
Diffstat (limited to 'curtis')
-rwxr-xr-xcurtis/.bin/hnel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/curtis/.bin/hnel.c b/curtis/.bin/hnel.c
index 0e270a5c..2f00711a 100755
--- a/curtis/.bin/hnel.c
+++ b/curtis/.bin/hnel.c
@@ -7,6 +7,8 @@ exec cc -Wall -Wextra -pedantic $@ -lutil -o $(dirname $0)/hnel $0
 #include <err.h>
 #include <poll.h>
 #include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
 #include <sysexits.h>
 #include <termios.h>
 #include <unistd.h>
@@ -35,6 +37,7 @@ static void restoreTerm(void) {
 }
 
 int main(int argc, char *argv[]) {
+    int error;
     if (argc < 2) return EX_USAGE;
 
     char table[256] = {0};
@@ -43,8 +46,12 @@ int main(int argc, char *argv[]) {
     table['j'] = 'e'; table['J'] = 'E'; table[CTRL('J')] = CTRL('E');
     table['k'] = 'n'; table['K'] = 'N'; table[CTRL('K')] = CTRL('N');
 
+    struct winsize window;
+    error = ioctl(STDERR_FILENO, TIOCGWINSZ, &window);
+    if (error) err(EX_IOERR, "ioctl");
+
     int master;
-    pid_t pid = forkpty(&master, NULL, NULL, NULL);
+    pid_t pid = forkpty(&master, NULL, NULL, &window);
     if (pid < 0) err(EX_OSERR, "forkpty");
 
     if (!pid) {
@@ -52,7 +59,7 @@ int main(int argc, char *argv[]) {
         err(EX_OSERR, "%s", argv[1]);
     }
 
-    int error = tcgetattr(STDERR_FILENO, &saveTerm);
+    error = tcgetattr(STDERR_FILENO, &saveTerm);
     if (error) err(EX_IOERR, "tcgetattr");
     atexit(restoreTerm);
 
href='/src/commit/bin/setopt.c?id=bfdf62e0dbe478e4afd3493a9410b2eac83fedc8&follow=1'>Remove setoptJune McEnroe 2020-03-03Use getopts in shell scriptsJune McEnroe WTF why did no one tell me about this? 2020-02-27Style %T outside of Rs in italicJune McEnroe 2020-02-26Add Fierce Femmes and Notorious LiarsJune McEnroe 2020-02-23Add This Is How You Lose the Time WarJune McEnroe 2020-02-22Add See Ya LaterJune McEnroe 2020-02-20Remove wiki scriptJune McEnroe Wikipedia seems to have removed the one-sentence extracts from the opensearch results. Too bad. It's not a wiki script, what we need is a command that fetches single-sentence summaries of articles on Wikipedia. 2020-02-19Add The Obelisk GateJune McEnroe 2020-02-17Add Four Tet — HandsJune McEnroe One from the cafe that caught my attention. 2020-02-12Simplify macOS notify-sendJune McEnroe 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe