mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-04 06:00:30 +00:00
Merge branch 'master' of github.com:dankamongmen/notcurses
This commit is contained in:
commit
1ad7f70fac
@ -75,7 +75,7 @@ relies on the font. Patches to correct/complete this table are very welcome!
|
||||
| [Guake](https://github.com/Guake/guake) | | ? |? | | |
|
||||
| [ITerm2](https://github.com/gnachman/iTerm2) | ✅ | ✅ |✅ |`TERM=xterm-256color` ||
|
||||
| [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` | |
|
||||
| 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. |
|
||||
|
@ -447,10 +447,13 @@ int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
|
||||
int tmp = *y;
|
||||
*y = *x;
|
||||
*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)){
|
||||
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;
|
||||
ncplane_dim_yx(np, &dimy, &dimx);
|
||||
if(np->sprite){
|
||||
if(xoff){
|
||||
// doing an x-move without specifying the y coordinate requires asking
|
||||
// the terminal where the cursor currently is.
|
||||
if(ncdirect_cursor_move_yx(n, -1, xoff)){
|
||||
return -1;
|
||||
}
|
||||
int y;
|
||||
const char* u7 = get_escape(&n->tcache, ESCAPE_U7);
|
||||
if(cursor_yx_get(n->tcache.ttyfd, u7, &y, NULL)){
|
||||
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
|
||||
// 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)){
|
||||
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;
|
||||
}
|
||||
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)f; // we don't write to the stream
|
||||
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
|
||||
size_t offset = ((l + y * ti->cellpixy) * ti->pixx + x * ti->cellpixx) * 4;
|
||||
uint8_t* tl = ti->linux_fbuffer + offset;
|
||||
|
Loading…
Reference in New Issue
Block a user