From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 YFoQK16kT2TiRwAASxT56A (envelope-from ) for ; Mon, 01 May 2023 13:37:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kGDkKl6kT2Rk/wAAauVa8A (envelope-from ) for ; Mon, 01 May 2023 13:37:02 +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 886688E2F for ; Mon, 1 May 2023 13:37:02 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptRpZ-00036d-Gj; Mon, 01 May 2023 07:36:33 -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 1ptRpQ-00030K-JF for emacs-orgmode@gnu.org; Mon, 01 May 2023 07:36:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptRpO-0000Zq-71 for emacs-orgmode@gnu.org; Mon, 01 May 2023 07:36:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1866F24019C for ; Mon, 1 May 2023 13:36:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1682940980; bh=ZXfOUFvtIOU8p6VWWCu+Dmd4eULoIId0ksllQl/w5zQ=; h=From:To:Cc:Subject:Date:From; b=eJk5ZMc1OF4AZZpNYVPPD+7Of9lMAaelnOfSJSYwbzoWkrfnj+IdB8fdXX1Hy04Z5 7pfd7XTAZwizqRIu/xlGIc+Rl9OIp7DbgBYlFW6aw4Po+V9YKTWl8n6XZTzr+CY0ba O5GaKVhGyfM25QWbKtynedQeckzjsw8JV7xda7jVKP/B7HYAx1NN85FYSM4Zv/rqbH nJ0lSirr0V5J/p278CBnVHoHUpFVJadiWkZyvi8pYX2ij0NDTm4STwV8TxzOEw9CVh zzsEtJRaMK2KEDxQYvI9tSXcT8+ioFxVTZbhCqY7Hu7+DN68YstociFHRx9dp64Svf hIHmANPSXCT9Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q91Pb4hsfz9rxB; Mon, 1 May 2023 13:36:19 +0200 (CEST) From: Ihor Radchenko To: "Christopher M. Miles" Cc: Org-mode , Matt 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) In-Reply-To: References: <87354hs9pz.fsf@localhost> <87mt2oqyup.fsf@localhost> Date: Mon, 01 May 2023 11:39:24 +0000 Message-ID: <877cts8emr.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , 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=1682941022; a=rsa-sha256; cv=none; b=fWSi2KhugZBfBJ79rYzDLg7cs0EdB73r4sFp4W24p9guwKB0iLHYJ+QOYINyUILNlUmkKK OhQOU7AJ988t4z+1toj8E7y5da1+e+//UjgccgqGDfKwa7+FV0f+zIcNbMf94r5qbZWdZs iJ2vKO26RsSzXyBVcD5gseGXtN7AczPImlxG9nMYW0fPJWWlRU5WDan1ozVEoNTYKDGmC+ 9NLslf0z2vVkQ52EnOSwCCjT227ShSnMb9phYqunVEbToh0+2+XIs/GMkNf6nQjdg8IMh+ LRoVB/FDzpnbtRnF5M4LImKSyKcFIk7ih708Fayqf2Y+JE0V55w46fBV2zx1hg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=eJk5ZMc1; dmarc=pass (policy=none) header.from=posteo.net; 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=1682941022; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZXfOUFvtIOU8p6VWWCu+Dmd4eULoIId0ksllQl/w5zQ=; b=loVmDt1k6rodQ8+k+LBaZtkbswWUZ3KcWs8HGbMMB477/nsf8timczmY9lCW9cuHHVTVU3 vtQV5phupAbjc+KKf0yLhpSSnjJva39W6MDRSypbVySxS3H4sv1WJ5nOm/yxD74BGqVdMY vG0iYqIbV1vD4R9T5lZcJq4WQ5bn66k2VLymq8wKAUkIIQw+hsskpZsHDHlWS2ZgqBpHx8 rPykIw2utHT1ZoV1UmxckO+KPm1QfCqao/Dmrs/oMZLf5GYvBpXmppOCxiGQGHO1+t4J65 DQk8yQuvIzh4WD5n1fNWKWKgCgyA9QAxM8jlkcjMB47aRmoidZPtQQh4FKtQWA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=eJk5ZMc1; dmarc=pass (policy=none) header.from=posteo.net; 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: -6.19 X-Spam-Score: -6.19 X-Migadu-Queue-Id: 886688E2F X-TUID: FAg3krysTW+8 "Christopher M. Miles" writes: >> So, it looks to me like mpv is somehow trying to interpret "echo" comman= ds 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.mp= 4" 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 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 '...' However, (1) ";" may not work in some shells; (2) may contain multiple lines, leading to the same issue. Matt, maybe you have some ideas about this edge case? --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at