commit 4810168266adb7ca42e37a8dc628e7274066ef4e
parent e448e3ea7dba4870a6b2c6d844db9958ec291a9b
Author: Ondřej Fiala <fiala.ondrej@volny.cz>
Date: Tue, 21 Nov 2023 01:59:57 +0100
gmnlm: update window size on every request to display more
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/gmnlm.c b/src/gmnlm.c
@@ -935,12 +935,6 @@ display_gemini(struct browser *browser, struct gemini_response *resp)
free(browser->page_title);
browser->page_title = NULL;
- struct winsize ws;
- ioctl(fileno(browser->tty), TIOCGWINSZ, &ws);
- if (browser->max_width != 0 && ws.ws_col > browser->max_width) {
- ws.ws_col = browser->max_width;
- }
-
FILE *out = browser->tty;
bool searching = browser->searching;
if (searching) {
@@ -953,12 +947,18 @@ display_gemini(struct browser *browser, struct gemini_response *resp)
struct link **next = &browser->links;
char prompt[4096];
- char *end = NULL;
int info_rows = 0;
+ struct winsize ws;
bool first_screen = 1;
while (text != NULL || gemini_parser_next(&p, &tok) == 0) {
repeat:
if (!row) {
+ ioctl(fileno(browser->tty), TIOCGWINSZ, &ws);
+ if (browser->max_width != 0 && ws.ws_col > browser->max_width) {
+ ws.ws_col = browser->max_width;
+ }
+
+ char *end = NULL;
if (browser->meta && (end = strchr(resp->meta, ';')) != NULL) {
*end = 0;
}