Merge branch 'master' of github.com:dankamongmen/notcurses

pull/2048/head
nick black 3 years ago
commit 1ad7f70fac
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -75,7 +75,7 @@ relies on the font. Patches to correct/complete this table are very welcome!
| [Guake](https://github.com/Guake/guake) | | ? |? | | | | [Guake](https://github.com/Guake/guake) | | ? |? | | |
| [ITerm2](https://github.com/gnachman/iTerm2) | ✅ | ✅ |✅ |`TERM=xterm-256color` || | [ITerm2](https://github.com/gnachman/iTerm2) | ✅ | ✅ |✅ |`TERM=xterm-256color` ||
| [Kitty](https://github.com/kovidgoyal/kitty) | ✅ | ✅ |✅ |`TERM=xterm-kitty` | See below. | | [Kitty](https://github.com/kovidgoyal/kitty) | ✅ | ✅ |✅ |`TERM=xterm-kitty` | See below. |
| [kmscon](https://github.com/dvdhrm/kmscon) | | ❌ | ❌ |`TERM=xterm-256color` | No RGB color AFAICT, nor any distinct terminfo entry. No actual `ccc` implementation. | | [kmscon](https://github.com/dvdhrm/kmscon) | | ❌ | ❌ |`TERM=xterm-256color` | No RGB color AFAICT, nor any distinct terminfo entry. No actual `ccc` implementation. Sets `COLORTERM=kmscon`.|
| [Konsole](https://invent.kde.org/utilities/konsole) | ❌ | ❌ |? |`TERM=konsole-direct` | | | [Konsole](https://invent.kde.org/utilities/konsole) | ❌ | ❌ |? |`TERM=konsole-direct` | |
| Linux console | ❌ | ✅ |see [below](#the-linux-console) |`TERM=linux` `COLORTERM=24bit` | 8 (512 glyph fonts) or 16 (256 glyph fonts) colors max, but RGB values are downsampled to a 256-index palette. See below. | | Linux console | ❌ | ✅ |see [below](#the-linux-console) |`TERM=linux` `COLORTERM=24bit` | 8 (512 glyph fonts) or 16 (256 glyph fonts) colors max, but RGB values are downsampled to a 256-index palette. See below. |
| [mlterm](https://github.com/arakiken/mlterm) | ✅ | ❌ |? |`TERM=mlterm-256color` | Do not set `COLORTERM`. `mlterm-direct` gives strange results. | | [mlterm](https://github.com/arakiken/mlterm) | ✅ | ❌ |? |`TERM=mlterm-256color` | Do not set `COLORTERM`. `mlterm-direct` gives strange results. |

@ -447,10 +447,13 @@ int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
int tmp = *y; int tmp = *y;
*y = *x; *y = *x;
*x = tmp; *x = tmp;
}else{
// we use 0-based coordinates, but known terminals use 1-based
// coordinates. the only known exception is kmscon, which is
// incidentally the only one which inverts its response.
--*y;
--*x;
} }
// we use 0-based coordinates, but known terminals use 1-based coordinates
--*y;
--*x;
} }
if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){ if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){
fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n", fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n",
@ -501,12 +504,13 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
int dimy, dimx; int dimy, dimx;
ncplane_dim_yx(np, &dimy, &dimx); ncplane_dim_yx(np, &dimy, &dimx);
if(np->sprite){ if(np->sprite){
if(xoff){ int y;
// doing an x-move without specifying the y coordinate requires asking const char* u7 = get_escape(&n->tcache, ESCAPE_U7);
// the terminal where the cursor currently is. if(cursor_yx_get(n->tcache.ttyfd, u7, &y, NULL)){
if(ncdirect_cursor_move_yx(n, -1, xoff)){ return -1;
return -1; }
} if(ncdirect_cursor_move_yx(n, y, xoff)){
return -1;
} }
// flush our FILE*, as we're about to use UNIX I/O (since we can't rely on // flush our FILE*, as we're about to use UNIX I/O (since we can't rely on
// stdio to transfer large amounts at once). // stdio to transfer large amounts at once).
@ -517,7 +521,7 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
if(fbuf_init(&f)){ if(fbuf_init(&f)){
return -1; return -1;
} }
if(sprite_draw(&n->tcache, NULL, np->sprite, &f, 0, xoff) < 0){ if(sprite_draw(&n->tcache, NULL, np->sprite, &f, y, xoff) < 0){
return -1; return -1;
} }
if(sprite_commit(&n->tcache, &f, np->sprite, true)){ if(sprite_commit(&n->tcache, &f, np->sprite, true)){

@ -173,7 +173,7 @@ int fbcon_draw(const tinfo* ti, const struct ncpile *p, sprixel* s, fbuf* f, int
(void)p; (void)p;
(void)f; // we don't write to the stream (void)f; // we don't write to the stream
int wrote = 0; int wrote = 0;
for(unsigned l = 0 ; l < (unsigned)s->pixy && l < ti->pixy ; ++l){ for(unsigned l = 0 ; l < (unsigned)s->pixy && l + y * ti->cellpixy < ti->pixy ; ++l){
// FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx // FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx
size_t offset = ((l + y * ti->cellpixy) * ti->pixx + x * ti->cellpixx) * 4; size_t offset = ((l + y * ti->cellpixy) * ti->pixx + x * ti->cellpixx) * 4;
uint8_t* tl = ti->linux_fbuffer + offset; uint8_t* tl = ti->linux_fbuffer + offset;

Loading…
Cancel
Save