[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ob-shell sessions will send final echo '...' as input key sequence when
From: |
Ihor Radchenko |
Subject: |
ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively (was: [Need Help] Error to evaluate "mpv" command in inline src block) |
Date: |
Mon, 01 May 2023 11:39:24 +0000 |
"Christopher M. Miles" <numbchild@gmail.com> 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 <RET>
4. Copy the following into kill ring
-----
mpv "枕刀歌/《枕刀歌》SE05 江海阔 歌谣哼唱.mp4"
m_
-----
5. (in the shell buffer): C-y <RET>
6. Observe mpv playing no sound and video
7. Press m_ to restore video and sound.
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 '....'
<your command>
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 '....'; <your command>; echo '...'
However, (1) ";" may not work in some shells; (2) <your command> may
contain multiple lines, leading to the same issue.
Matt, maybe you have some ideas about this edge case?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: [Need Help] Error to evaluate "mpv" command in inline src block, Ihor Radchenko, 2023/05/01
- Re: [Need Help] Error to evaluate "mpv" command in inline src block, Christopher M. Miles, 2023/05/01
- ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively (was: [Need Help] Error to evaluate "mpv" command in inline src block),
Ihor Radchenko <=
- Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively, Christopher M. Miles, 2023/05/01
- Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively, Ihor Radchenko, 2023/05/01
- Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively, Christopher M. Miles, 2023/05/01
- Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively, Ihor Radchenko, 2023/05/01
- Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively, Christopher M. Miles, 2023/05/01
- [SOLUTION] a temporary workaround solution using another language like "python", Christopher M. Miles, 2023/05/01
- Message not available
- Re: [SOLUTION] a temporary workaround solution using another language like "python", Max Nikulin, 2023/05/01
- Re: [SOLUTION] a temporary workaround solution using another language like "python", Christopher M. Miles, 2023/05/01
- Re: [SOLUTION] a temporary workaround solution using another language like "python", Ihor Radchenko, 2023/05/01
- [CLOSED] [ANSWER] Re: a temporary workaround solution using another language like "python", Christopher M. Miles, 2023/05/02