diff --git a/src/lib/internal.h b/src/lib/internal.h index 456ffd200d..ce089bb9fc 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -1166,7 +1166,7 @@ goto_location(notcurses* nc, fbuf* f, int y, int x, const ncplane* srcp){ const char* hpa = get_escape(&nc->tcache, ESCAPE_HPA); if(nc->rstate.y == y && hpa && !nc->rstate.hardcursorpos){ // only need move x if(nc->rstate.x == x){ - if(nc->rstate.lastsrcp == srcp){ + if(nc->rstate.lastsrcp == srcp || !nc->tcache.gratuitous_hpa){ return 0; // needn't move shit } ++nc->stats.s.hpa_gratuitous; diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index 921652fd5f..d8a3952fb6 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -585,6 +585,7 @@ apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm // kitty SUM doesn't want long sequences, which is exactly where we use // it. remove support (we pick it up from queries). kill_appsync_escapes(ti); + ti->gratuitous_hpa = true; }else if(qterm == TERMINAL_ALACRITTY){ termname = "Alacritty"; ti->caps.quadrants = true; diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index 116f7ea8ad..3ab1545536 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -167,6 +167,8 @@ typedef struct tinfo { struct termios *tpreserved;// terminal state upon entry struct inputctx* ictx; // new input layer unsigned stdio_blocking_save; // was stdio blocking at entry? restore on stop. + // ought we issue gratuitous HPAs to work around ambiguous widths? + unsigned gratuitous_hpa; // if we get a reply to our initial \e[18t cell geometry query, it will // replace these values. note that LINES/COLUMNS cannot be used to limit