mpvc icon indicating copy to clipboard operation
mpvc copied to clipboard

Weird terminal glitch

Open edn9 opened this issue 5 years ago • 5 comments

https://youtu.be/-RLFYJibT6k So this is happening to me (xst - bash) and my friend (alacritty - mksh[?]). When you start the mpvc, looks like it make a glitch that begin to hidden/blend/mix(?) some words in a level that even make the terminal stop working of receivecommands.

Im using VoidLinux. And thanks for the program!

edn9 avatar Feb 14 '19 07:02 edn9

How bizarre. I haven't run mpvc myself for a long time, but I should be jumping back on the linux bandwagon in a couple of weeks again. I'll take a look then.

In the meantime if possible use sh -x to trace through the program when you run it and see if it stops unexpectedly, other issues, etc, I suspect it's probably the ipc interface to mpv causing this.

lwilletts avatar Feb 14 '19 17:02 lwilletts

@necronoise Can you try using --no-terminal instead of --really-quiet at: https://github.com/lwilletts/mpvc/blob/998604e339479ea4d37c6568af627030b2a1c69c/mpvc#L256

heckendorfc avatar Feb 23 '19 21:02 heckendorfc

@necronoise Can you try using --no-terminal instead of --really-quiet at:

mpvc/mpvc

Line 256 in 998604e exec mpv --really-quiet --idle=once --input-ipc-server="${SOCKET}" \

I tried but still the same. image

edn9 avatar Feb 23 '19 21:02 edn9

I think I have been experiencing this myself, although to a lesser degree than shown in the video. mpvc keeps the input grabbed and only ^C returns control back to me. Basically, the script isn't ending properly at a certain point, just need to find it.

lwilletts avatar Apr 06 '19 13:04 lwilletts

I've also noticed this.

Although not a complete fix, I've observed that at some point tty echo is disabled. So the easy fix was saving/restoring tty settings that at least mitigates the issue, although, it should be desirable to find what/why tty echo is being turned off.

Below is the change I did to avoid being left with tty echo disabled: https://github.com/gmt4/mpvc/commit/f34d0880bc24a770e03ca58330059ffbfb7d8c8c

gmt4 avatar Apr 16 '22 21:04 gmt4

I solved this problem by modifying this line https://github.com/lwilletts/mpvc/blob/52b56dd5e9beab0c625151255575364c02c89f1b/mpvc#L393 to this: $MPVOPTIONS "$filename" > /dev/null 2>&1 &

crshrprt avatar Oct 12 '22 09:10 crshrprt

I've been bitten by this too when using mpvc.

The issue is that mpv defaults to --input-terminal Flag (default: yes) (check mpv --list-options). This means that when mpv is started with this option enabled, manages the terminal tty to react to the keyboard keys to pause/play/seek etc.

Once this is disabled, mpv stops managing the terminal tty, and the issue does not happen.

This can be easily done by setting MPVOPTIONS as in https://github.com/gmt4/mpvc/commit/8a61c2ef288e64cae3689f7549a9d68cd625513a:

HTH

diff --git a/mpvc b/mpvc
index 137220f..e70634d 100755
--- a/mpvc
+++ b/mpvc
@@ -6,7 +6,7 @@
 
 SOCKETCOMMAND=""
 SOCKET=${MPVC_SOCKET:-/tmp/mpvsocket}
-MPVOPTIONS="--no-audio-display"
+MPVOPTIONS="--no-audio-display --no-input-terminal"

@lwilletts @edn9 @crshrprt

gmt4 avatar Nov 15 '22 08:11 gmt4

Should be solved then with the merge.

lwilletts avatar Jul 19 '23 20:07 lwilletts