Skip to content

Commit

Permalink
[core] enable ghpa only on kitty for now #2199
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Oct 28, 2021
1 parent 8ee8b00 commit 0eda63d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/lib/termdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/termdesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0eda63d

Please sign in to comment.