Zend certified PHP/Magento developer

Prevent mpv from Clearing Terminal Screen Post Video Playback

I am using mpv with the --vo=tct flag to play videos directly in the terminal. I am interested in finding out if there’s a way to prevent mpv from clearing the terminal screen when the video is either finished or interrupted.

I’ve tried a few solutions found online, but they do not fully address my needs:

  • The --keep-open=yes flag does stop the video at the end, but it prevents me from using the terminal unless I exit mpv, which results in the terminal being cleared.

  • Suspending the process using Ctrl + Z is not effective as it causes the prompt’s position to overlap with the video image, resulting in a distorted display. Additionally, it conceals the cursor when typing commands.

  • The --player-operation-mode=pseudo-gui flag somewhat works, but it suppresses the mpv output on the screen, which I need to see during video playback.

If you got any insights, I’m all ears 🙂