if (!o)
return NULL;
+ /* re-enable cursor */
+ output_printf(o, "\e[?25h");
/* disable alternate screen buffer */
output_printf(o, "\e[?1049l");
output_flush(o);
if (r < 0)
goto error;
+ /* always hide cursor */
+ r = output_printf(o, "\e[?25l");
+ if (r < 0)
+ goto error;
+
r = output_flush(o);
if (r < 0)
goto error;
else
output_draw_screen(o, screen);
- /* show cursor */
- if (!(screen->flags & TERM_FLAG_HIDE_CURSOR))
- output_printf(o, "\e[?25h");
-
/*
* Hack: sd-term was not written to support TTY as output-objects, thus
* expects callers to use term_screen_feed_keyboard(). However, we
line_age = MAX(line->age, page->age);
for (i = 0; i < page->width; ++i) {
+ term_attr attr;
+
cell = &line->cells[i];
cell_age = MAX(cell->age, line_age);
* renderers can assume ch_width is set properpy. */
cw = MAX(cell->cwidth, 1U);
+ attr = cell->attr;
+ if (i == screen->cursor_x && j == screen->cursor_y &&
+ !(screen->flags & TERM_FLAG_HIDE_CURSOR))
+ attr.inverse ^= 1;
+
r = draw_fn(screen,
userdata,
i,
j,
- &cell->attr,
+ &attr,
ch_str,
ch_n,
cw);