vo_sixel: Alias/deprecate exit-clear -> alt-screen

Also update documentation to reflect actual behavior.
This commit is contained in:
Mia Herkt 2022-12-20 10:22:51 +01:00
parent 12c3203e98
commit a4cac2ddc6
No known key found for this signature in database
GPG Key ID: 72E154B8622EC191
3 changed files with 18 additions and 10 deletions

View File

@ -28,8 +28,11 @@ Interface changes
--- mpv 0.36.0 ---
- add `--force-render`
- add `--vo-sixel-draw-clear` and `--vo-sixel-buffered`
- add `--vo-sixel-draw-clear`, `--vo-sixel-alt-screen` and
`--vo-sixel-buffered`
- add `--wayland-content-type`
- deprecate `--vo-sixel-exit-clear` and alias it to
`--vo-sixel-alt-screen`
- deprecate `--drm-atomic`
--- mpv 0.35.0 ---
- add the `--vo=gpu-next` video output driver, as well as the options

View File

@ -438,10 +438,13 @@ Available video output drivers are:
``--vo-sixel-draw-clear=<yes|no>`` (default: yes)
Whether or not to clear the terminal while drawing frames.
``--vo-sixel-exit-clear=<yes|no>`` (default: yes)
Whether or not to clear the terminal on quit. When set to no - the
last sixel image stays on screen after quit, with the cursor following
it.
``--vo-sixel-alt-screen=<yes|no>`` (default: yes)
Whether or not to use the alternate screen buffer and return the
terminal to its previous state on exit. When set to no, the last
sixel image stays on screen after quit, with the cursor following it.
``--vo-sixel-exit-clear`` is a deprecated alias for this option and
may be removed in the future.
``--vo-sixel-buffered=<yes|no>`` (default: no)
Buffers the full output sequence before writing it to the terminal.

View File

@ -56,7 +56,7 @@ struct vo_sixel_opts {
int width, height, top, left;
int pad_y, pad_x;
int rows, cols;
int draw_clear, exit_clear;
int draw_clear, alt_screen;
int buffered;
};
@ -504,7 +504,7 @@ static int preinit(struct vo *vo)
sixel_output_set_encode_policy(priv->output, SIXEL_ENCODEPOLICY_FAST);
if (priv->opts.exit_clear)
if (priv->opts.alt_screen)
sixel_strwrite(TERM_ESC_SAVE_SCREEN);
sixel_strwrite(TERM_ESC_HIDE_CURSOR);
@ -548,7 +548,7 @@ static void uninit(struct vo *vo)
sixel_strwrite(TERM_ESC_RESTORE_CURSOR);
if (priv->opts.exit_clear)
if (priv->opts.alt_screen)
sixel_strwrite(TERM_ESC_RESTORE_SCREEN);
fflush(stdout);
@ -587,7 +587,7 @@ const struct vo_driver video_out_sixel = {
.opts.rows = 0,
.opts.cols = 0,
.opts.draw_clear = 1,
.opts.exit_clear = 1,
.opts.alt_screen = 1,
.opts.buffered = 0,
},
.options = (const m_option_t[]) {
@ -613,7 +613,9 @@ const struct vo_driver video_out_sixel = {
{"rows", OPT_INT(opts.rows)},
{"cols", OPT_INT(opts.cols)},
{"draw-clear", OPT_FLAG(opts.draw_clear), },
{"exit-clear", OPT_FLAG(opts.exit_clear), },
{"exit-clear", OPT_FLAG(opts.alt_screen),
.deprecation_message = "replaced by --vo-sixel-alt-screen"},
{"alt-screen", OPT_FLAG(opts.alt_screen), },
{"buffered", OPT_FLAG(opts.buffered), },
{0}
},