From b3be18a0bfb55135135c9769ac531c098ca4d26c Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 13 Jun 2025 21:11:12 +0200 Subject: fix(yt/watch/playlist): Workaround terminals, that treat 0 as 1 --- yt/src/watch/playlist.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yt/src/watch/playlist.rs b/yt/src/watch/playlist.rs index 6ac8b12..5be46ce 100644 --- a/yt/src/watch/playlist.rs +++ b/yt/src/watch/playlist.rs @@ -38,7 +38,11 @@ fn erase_in_display_from_cursor() { print!("{CSI}0J"); } fn cursor_up(number: usize) { - print!("{CSI}{number}A"); + // HACK(@bpeetz): The default is `1` and running this command with a + // number of `0` results in it using the default (i.e., `1`) <2025-03-25> + if number != 0 { + print!("{CSI}{number}A"); + } } // }}} -- cgit 1.4.1