From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kLcCLou3T2TLCAEASxT56A (envelope-from ) for ; Mon, 01 May 2023 14:58:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0K30LYu3T2QPYgAA9RJhRA (envelope-from ) for ; Mon, 01 May 2023 14:58:51 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 59ADCAE1A for ; Mon, 1 May 2023 14:58:51 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptT69-0000mc-HB; Mon, 01 May 2023 08:57:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptT66-0000m9-Vc for emacs-orgmode@gnu.org; Mon, 01 May 2023 08:57:42 -0400 Received: from [2409:8a28:6038:2b80:52d2:f5ff:fe16:c591] (helo=Mac-mini.local) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptT64-0007Ep-IB for emacs-orgmode@gnu.org; Mon, 01 May 2023 08:57:42 -0400 Received: by Mac-mini.local (Postfix, from userid 501) id 097EE8AA0131; Mon, 1 May 2023 20:57:31 +0800 (CST) References: <87354hs9pz.fsf@localhost> <87mt2oqyup.fsf@localhost> <877cts8emr.fsf@localhost> User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Ihor Radchenko Cc: "Christopher M. Miles" , Org-mode , Matt Subject: Re: ob-shell sessions will send final echo '...' as input key sequence when previous command reads input interactively Date: Mon, 01 May 2023 20:50:15 +0800 In-reply-to: <877cts8emr.fsf@localhost> Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:8a28:6038:2b80:52d2:f5ff:fe16:c591 (deferred) Received-SPF: softfail client-ip=2409:8a28:6038:2b80:52d2:f5ff:fe16:c591; envelope-from=numbchild@gmail.com; helo=Mac-mini.local X-Spam_score_int: 25 X-Spam_score: 2.5 X-Spam_bar: ++ X-Spam_report: (2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL_NO_RDNS=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682945931; a=rsa-sha256; cv=none; b=D7iOivgtboqT1V9vZcd7Ri5Grt5bJToyzJUCUd88ycubAem1Ss9DbAGMwhNkz3fg64YIsa yEVENKyFIncbYrFuizOqH9qgodmYx6Ltdv+G06I4FaZPWFFPKqbNiTvAYRkYwR7buNi7Wd 9MU6WrFt32MHQFxOWfnIXRnEiYghK0cBzZUuB5sYKQwJEot5+SpDXIAz2YpdOTUOndTa9s V0yz2njTvquxz0I1xWAzHItANrE8nIHYwcWFqa3OY2QVu4/xw8EQesuKNLZxnccSHrv3Nk QwkfC99DCTaUNe6VkgMJiGb4UdgS3+kOTAjt2k0CfGMobiC5X5ob6ts2E7ct1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682945931; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=QmPohx+8R/AkTDLjlE+fxIsbDfV8HEQNH1pOrOri7IY=; b=RvRDCH/c3MrbP+yaDybkUjuki2nbbPAQJXB+mJIFvHc4N4x9ktZwoPNLqM+3y30P/KAzu1 qCXCs2r2je2HPBhM83VCeisSof9TNtIaKbfhJoFX7zbGKUB3rAYPiqHPeoN7BBhn5ou1oQ ivI/E6PdYETTp+ktLtIP8EDffcRG+49aJO5+qyuJVzDhYkLZEALwv/3V6s0Vd5Kpo2KmEL Nb5s1Fx7QkDcrFbWpi68nyNNKGPXJ9NEOliRk+doLaZ09q6b5s8FCRZR1GbSpZTodw8eZT fgaHeq/Bq02k5x7M2jzozQlRQFrTkjA+zxEEFqBVA3k7ehEg745P01tYd5U3qw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.89 X-Spam-Score: 0.89 X-Migadu-Queue-Id: 59ADCAE1A X-TUID: oGBaQfHDHnmp --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> So, it looks to me like mpv is somehow trying to interpret "echo" comma= nds 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 "=E6=9E=95=E5=88=80=E6=AD=8C/=E3=80=8A=E6=9E=95=E5=88=80=E6=AD=8C=E3= =80=8BSE05 =E6=B1=9F=E6=B5=B7=E9=98=94 =E6=AD=8C=E8=B0=A3=E5=93=BC=E5=94=B1= .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 ech= o 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. =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRPtzsACgkQG13xyVro msNuTwgAsZ8o3J8KI2Oq6iGctMGG3kdOW8PUhOIDBq1U9TRhpNmZa4EYmaQtN7wr XXXZY9hAPf8xSk4JfgzWMCfVRrWUcqo7tQAQVwuAcwarLyQnKD8Zuw8FDINcDBvp MjeJp/kWPUWsD5/HYseEUq80JODki1iXpzbHjDSwLc/Ol8M+uCUhDz9LozYv6a92 tj/wqM4vg5nl5TYy4bIY0AVXQQoZETKwWftf7p6YwpNYtn/bBahTqVRjtJKYbOuV Fsj2MPlIP+SgwAaydQdeU5xPWjsMFfgF/w0VU1A1XxHipm7AwXQP5CbmFTTXt1V4 FnvXUNfRnWM8vB/fFPV3C19lE82MAQ== =o+cL -----END PGP SIGNATURE----- --=-=-=--