Skip to content

Commit

Permalink
chafa: Ensure cursor advances down after sixels (when impolite)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpjansson committed Jun 11, 2023
1 parent cfe3002 commit 21c752a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/chafa/chafa.c
Expand Up @@ -1319,7 +1319,7 @@ tty_options_init (void)

if (!options.polite)
{
gchar buf [CHAFA_TERM_SEQ_LENGTH_MAX];
gchar buf [CHAFA_TERM_SEQ_LENGTH_MAX * 2];
gchar *p0;

#ifdef HAVE_TERMIOS_H
Expand All @@ -1340,11 +1340,12 @@ tty_options_init (void)
write_to_stdout (buf, p0 - buf);
}

/* Most terminals should have sixel scrolling enabled by default, so we're
* not going to disable it again later. */
if (options.pixel_mode == CHAFA_PIXEL_MODE_SIXELS)
{
/* Most terminals should have sixel scrolling and advance-down enabled
* by default, so we're not going to undo these later. */
p0 = chafa_term_info_emit_enable_sixel_scrolling (options.term_info, buf);
p0 = chafa_term_info_emit_enable_advance_down_after_sixel (options.term_info, p0);
write_to_stdout (buf, p0 - buf);
}
}
Expand Down

0 comments on commit 21c752a

Please sign in to comment.