Skip to content

Commit

Permalink
chafa: Emit newline/index after sixel image
Browse files Browse the repository at this point in the history
This positions the cursor correctly ~everywhere.

See #192 (GitHub).
  • Loading branch information
hpjansson committed Mar 8, 2024
1 parent 0965f9b commit b1aa68f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tools/chafa/chafa.c
Expand Up @@ -2590,19 +2590,19 @@ write_image_epilogue (gint dest_width)
}
else /* CHAFA_PIXEL_MODE_SIXELS */
{
/* Sixel mode leaves cursor somewhere at or below the leftmost column */
/* Sixel mode leaves the cursor in the leftmost column of the final band */

if (left_space > 0)
if (options.relative)
{
if (options.relative)
{
p0 = chafa_term_info_emit_cursor_down_scroll (options.term_info, p0);

if (left_space > 0)
p0 = chafa_term_info_emit_cursor_left (options.term_info, p0,
left_space);
}
else
{
*(p0++) = '\r';
}
}
else
{
*(p0++) = '\n';
}
}

Expand Down

0 comments on commit b1aa68f

Please sign in to comment.