diff --git a/src/lib/kitty.c b/src/lib/kitty.c index c1f5850cf..ac8ad2300 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -428,6 +428,7 @@ write_kitty_data(FILE* fp, int linesize, int leny, int lenx, int cols, fclose(fp); return -1; } + bool scroll = false; // FIXME bool translucent = bargs->flags & NCVISUAL_OPTION_BLEND; int sprixelid = bargs->u.pixel.spx->id; int cdimy = bargs->u.pixel.celldimy; @@ -443,8 +444,9 @@ write_kitty_data(FILE* fp, int linesize, int leny, int lenx, int cols, //fprintf(stderr, "total: %d chunks = %d, s=%d,v=%d\n", total, chunks, lenx, leny); while(chunks--){ if(totalout == 0){ - *parse_start = fprintf(fp, "\e_Gf=32,s=%d,v=%d,i=%d,a=T,%c=1;", - lenx, leny, sprixelid, chunks ? 'm' : 'q'); + *parse_start = fprintf(fp, "\e_Gf=32,s=%d,v=%d,i=%d,a=T,%c=1%s;", + lenx, leny, sprixelid, chunks ? 'm' : 'q', + scroll ? "" : ",C=1"); }else{ fprintf(fp, "\e_G%sm=%d;", chunks ? "" : "q=2,", chunks ? 1 : 0); } diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index ce8109c90..5d4f0d20e 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -21,6 +21,7 @@ setup_sixel_bitmaps(tinfo* ti){ static inline void setup_kitty_bitmaps(tinfo* ti, int fd){ + ti->bitmap_supported = true; ti->pixel_wipe = kitty_wipe; ti->pixel_destroy = kitty_destroy; ti->pixel_remove = kitty_remove; @@ -29,6 +30,7 @@ setup_kitty_bitmaps(tinfo* ti, int fd){ ti->sprixel_scale_height = 1; ti->pixel_rebuild = kitty_rebuild; ti->pixel_clear_all = kitty_clear_all; + ti->bitmap_lowest_line = true; set_pixel_blitter(kitty_blit); sprite_init(ti, fd); } @@ -91,7 +93,6 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd){ ti->sextants = true; // work since bugfix in 0.19.3 ti->quadrants = true; ti->pixel_query_done = true; - ti->bitmap_supported = true; ti->RGBflag = true; setup_kitty_bitmaps(ti, fd); }else if(strstr(termname, "alacritty")){ diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index 9833d2dd7..a7f0d983e 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -121,6 +121,7 @@ typedef struct tinfo { struct termios tpreserved; // terminal state upon entry ncinputlayer input; // input layer bool bitmap_supported; // do we support bitmaps (post pixel_query_done)? + bool bitmap_lowest_line; // can we render pixels to the bottom row? bool pixel_query_done; // have we yet performed pixel query? bool RGBflag; // "RGB" flag for 24bpc truecolor bool CCCflag; // "CCC" flag for palette set capability diff --git a/src/lib/visual.c b/src/lib/visual.c index ddf72d339..1de9ac5db 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -773,7 +773,10 @@ make_sprixel_plane(notcurses* nc, ncplane* parent, ncvisual* ncv, if(scaling != NCSCALE_NONE && scaling != NCSCALE_NONE_HIRES){ ncplane_dim_yx(parent, disppixy, disppixx); if(*placey + *disppixy >= ncplane_dim_y(notcurses_stdplane_const(nc))){ - *disppixy = ncplane_dim_y(notcurses_stdplane_const(nc)) - *placey - 1; + *disppixy = ncplane_dim_y(notcurses_stdplane_const(nc)) - *placey; + if(!nc->tcache.bitmap_lowest_line){ + --*disppixy; + } } if(!(flags & NCVISUAL_OPTION_VERALIGNED)){ *disppixy -= *placey; diff --git a/src/player/play.cpp b/src/player/play.cpp index 969d2d5ac..aaaec107f 100644 --- a/src/player/play.cpp +++ b/src/player/play.cpp @@ -385,7 +385,7 @@ int rendered_mode_player_inner(NotCurses& nc, int argc, char** argv, // leave a line at the bottom. perhaps one day we'll put information there. // for now, this keeps us from scrolling when we use bitmaps. if(nopts.margin_b == 0){ - nopts.margin_b = 1; + //nopts.margin_b = 1; } nopts.name = "play"; nopts.resizecb = ncplane_resize_marginalized;