From bc213921be2f65c97b91c94e70108c285f75dd01 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 4 Jul 2021 06:23:47 -0400 Subject: [PATCH] interrogate_terminfo: placeholders for cursor always get the cursor location from query responses, so that we load u7 into the escape table even though it wasn't found in terminfo. this is needed on freebsd, where termcap doesn't seem to have u7 in it. --- src/lib/termdesc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index e46f01a2b..9a9a5daf5 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -651,9 +651,14 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8, } } unsigned appsync_advertised = 0; - if(cursor_x && cursor_y){ - *cursor_x = *cursor_y = 0; + int foolcursor_x, foolcursor_y; + if(!cursor_x){ + cursor_x = &foolcursor_x; + } + if(!cursor_y){ + cursor_y = &foolcursor_y; } + *cursor_x = *cursor_y = 0; if(ncinputlayer_init(ti, stdin, &qterm, &appsync_advertised, cursor_y, cursor_x)){ goto err; }