From 26a425cf05ef2636280a68ee8243a08eba432924 Mon Sep 17 00:00:00 2001 From: whyshouldibother <113842019+whyshouldibother@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:07:24 +0545 Subject: [PATCH 1/3] Tty comptaible --- ani-cli | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/ani-cli b/ani-cli index 37a18368c..cd60e1e21 100755 --- a/ani-cli +++ b/ani-cli @@ -2,6 +2,9 @@ version_number="4.14.1" +#flags +use_tty=0 +tty_mode=0 # UI external_menu() { @@ -414,10 +417,23 @@ play_episode() { printf "%s\n" "$episode" ;; mpv*) + if [ "$use_tty" = 1 ]; then + case "$tty_mode" in + 1) + tty_flags="--vo=tct --really-quiet" + ;; + 2) + tty_flags="--vo=gpu --gpu-context=drm" + ;; + *) + tty_flags="--vo=tct --realy-quiet" + ;; + esac + fi if [ "$no_detach" = 0 ]; then - nohup $player_function $skip_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" $refr_flag >/dev/null 2>&1 & + nohup $player_function $tty_flags $skip_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" $refr_flag >/dev/null 2>&1 & else - $player_function $skip_flag $refr_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" + $player_function $tty_flags $skip_flag $refr_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" mpv_exitcode=$? [ "$exit_after_play" = 1 ] && [ -z "$range" ] && exit "$mpv_exitcode" fi @@ -514,6 +530,19 @@ branch="${ANI_CLI_BRANCH:-master}" while [ $# -gt 0 ]; do case "$1" in + -t | --tty) + use_tty=1 + no_detach=1 + tty_mode=1 + if [ $# -gt 1 ]; then + case "$2" in + 1|2) + tty_mode="$2" + shift + ;; + esac + fi + ;; -v | --vlc) case "$(uname -a | cut -d " " -f 1,3-)" in *ndroid*) player_function="android_vlc" ;; From b7310f4cb2c2aabea02ede79adfd9a306fef3033 Mon Sep 17 00:00:00 2001 From: whyshouldibother <113842019+whyshouldibother@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:11:19 +0545 Subject: [PATCH 2/3] Added tct and drm backend to make ani-cli compatible with tty --- ani-cli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ani-cli b/ani-cli index cd60e1e21..45161d1b6 100755 --- a/ani-cli +++ b/ani-cli @@ -59,6 +59,10 @@ help_info() { Delete history -l, --logview Show logs + -t, --tty + Use tct or drm backend to use it in tty + tty 1 = tct (default) + tty 2 = drm -s, --syncplay Use Syncplay to watch with friends -S, --select-nth From e25bd4d75a229fec76ee952ca0cac7b1d729b732 Mon Sep 17 00:00:00 2001 From: whyshouldibother <113842019+whyshouldibother@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:32:04 +0545 Subject: [PATCH 3/3] use drm directly --- ani-cli | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ani-cli b/ani-cli index 45161d1b6..d8555f81c 100755 --- a/ani-cli +++ b/ani-cli @@ -427,10 +427,7 @@ play_episode() { tty_flags="--vo=tct --really-quiet" ;; 2) - tty_flags="--vo=gpu --gpu-context=drm" - ;; - *) - tty_flags="--vo=tct --realy-quiet" + tty_flags="--vo=drm" ;; esac fi