[core] enable ghpa only on kitty for now #2199

This commit is contained in:
nick black 2021-10-28 04:05:04 -04:00 committed by nick black
parent 8ee8b0081d
commit 0eda63daa5
3 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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