Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> So, it looks to me like mpv is somehow trying to interpret "echo" commands the >>> ob-shell is sending after "mpv ...." is executed: >> ... >> Don't know ob-shell which part did your said "echo" commands. I don't >> know where to dig this issue. Hope you can help. Thanks for your >> reproducing problem and dive in. > > The underlying issue lies within how comint works + the fact that mpv > reads key input from terminal. > > Try the following: > > 1. emacs -Q > 2. M-x shell > 3. cd /path/to/your/video > 4. Copy the following into kill ring > ----- > mpv "枕刀歌/《枕刀歌》SE05 江海阔 歌谣哼唱.mp4" > m_ > ----- > 5. (in the shell buffer): C-y > 6. Observe mpv playing no sound and video > 7. Press m_ to restore video and sound. > I reproduced same now. Thanks for your guide. > I am not sure if we can do much about this though. > We run async shell commands in sessions using > > (insert (format ob-shell-async-indicator "start" uuid)) > (comint-send-input nil t) > (insert (org-trim body)) > (comint-send-input nil t) > (insert (format ob-shell-async-indicator "end" uuid)) > (comint-send-input nil t) > > which sends > > "echo '....' > > echo '...'" > > to comint terminal session. > > The last echo '...' in this case is interpreted as key input by mpv - > symbol by symbol. > > The only way I know how to work around this is a giant one-liner like > echo '....'; ; echo '...' > I understand the process now, it is wrapped by ob-shell-async-indicator echo command. > However, (1) ";" may not work in some shells; (2) may > contain multiple lines, leading to the same issue. I tested it (using ";") now, not working. I might consider to use another language like python instead of sh to execute command to play video to get around this issue. I will update here if I success. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3