diff --git a/src/gmnlm.c b/src/gmnlm.c
index 041096cc5f0117632f80b0427b9a916aaa6401c2..c56f3a2d393b7d475f3b859a9a8ed4ca922186a3 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -948,6 +948,10 @@ int row = 0, col = 0;
bool no_alttext;
struct gemini_token tok;
struct link **next = &browser->links;
+ // When your screen is too narrow, more lines will be used for helptext and URL.
+ // 87 is the maximum width of the prompt.
+ int info_rows = (ws.ws_col >= 87) ? 4 : 6;
+
while (text != NULL || gemini_parser_next(&p, &tok) == 0) {
repeat:
switch (tok.token) {
@@ -1043,7 +1047,7 @@
if (text) {
int w = wrap(out, text, &ws, &row, &col);
text += w;
- if (text[0] && row < ws.ws_row - 4) {
+ if (text[0] && row < ws.ws_row - info_rows) {
continue;
}
@@ -1062,7 +1066,7 @@ }
++row; col = 0;
fprintf(out, ANSI_COLOR_RESET);
- if (browser->pagination && row >= ws.ws_row - 4) {
+ if (browser->pagination && row >= ws.ws_row - info_rows) {
char prompt[4096];
char *end = NULL;
if (browser->meta && (end = strchr(resp->meta, ';')) != NULL) {