From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aIfYI945UmRr+AAASxT56A (envelope-from ) for ; Wed, 03 May 2023 12:39:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MCvbI945UmSuYwEA9RJhRA (envelope-from ) for ; Wed, 03 May 2023 12:39:26 +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 2B687149F4 for ; Wed, 3 May 2023 12:39:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu9sT-00057E-Ig; Wed, 03 May 2023 06:38:29 -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 1pu9sR-00056l-Ek for emacs-orgmode@gnu.org; Wed, 03 May 2023 06:38:27 -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 1pu9sN-0001VL-U8 for emacs-orgmode@gnu.org; Wed, 03 May 2023 06:38:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 60F8F24013D for ; Wed, 3 May 2023 12:38:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683110301; bh=FifZ2ZAujNJiZ/XvHVB+S7QTpXxaEPO7eWgrnYdln7k=; h=From:To:Cc:Subject:Date:From; b=cSxttC7/ZevhHlF/1VcCM8SnxF5p30RhC39yX1pMpcGQeWZId4UAGZGR3Ko6FDWBf WUwzuccpsviw7fCmyq04CZMuG4zPQaiJCH0wFX7AG1Xa0BeRSnv/7O6Vx7F3hYCIw0 kipwqyQpTHleVi8mWlzpRBAqxYwhN6Bcde2m66mLjoLQZYPHILnW0EW0BdcStWukM9 i1NNxKxjPJtq9e+fvSampnOQilDWe9wL5ccOS8QpK+zYB9PGWrGbAn32SpRsqtcbbd rOGFSgHIx+Pj6/4UDJdX0kMW6UfKVJgYCmgvgbJ3KN2r2q6W3CIJPI4btKF9gWc6Yc MEjtUTUzhz5Bg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QBD1m60sPz9rxS; Wed, 3 May 2023 12:38:20 +0200 (CEST) From: Ihor Radchenko To: Matt Cc: Org-mode Subject: Re: 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: <187de29d882.c92c2b661216812.7786590004610447376@excalamus.com> References: <87354hs9pz.fsf@localhost> <87mt2oqyup.fsf@localhost> <877cts8emr.fsf@localhost> <187de29d882.c92c2b661216812.7786590004610447376@excalamus.com> Date: Wed, 03 May 2023 10:41:32 +0000 Message-ID: <878re5g0ir.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683110366; a=rsa-sha256; cv=none; b=U38Q/WtaggivoY//DT1cw/7Vp3z5ITpZ2Pe1EXX7Sp4eTrX7T7zPklLrWgR5uy3jp7sdo/ GKikmwTphkn2OPujSylvxUvPKziFLwzix8cn5Tkk1ZI56rd5+p25uR0+PalDXqjh4YVuIN D1yiuYGcxWDzyhoY/c1LgieSiD8PaqvpHUET8KjB9L8M6yMCXSIyAfaJu66g0BibgL+oVV CJmIe4xT1wUQXUrr2FJIch3kTiCZSaeEVtagTqofWIAxIat7d8euiRgQuYMcVeReHFyjDQ M9+f5+zCSGRdrodYpLR4MTien4YuQVTYrt366LIxt1emjy14pGXzleWBqQgNnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="cSxttC7/"; 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=1683110366; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KRaJPqNBliEkiGqirNgW04fjURQ0oEJQOd8f85sOxjQ=; b=QdZuYhBRQ1//+0Ecw0GV523Y4JByKmlgJtmvpoft9/YxHqsElF07JD4wgSF7gsZGaDma/V SYvYx0p0rgjj9rRoLqh+QxpEVZUPod/BhwMWVEJ7YV1dFk49xJ1KKcgaF26gTdhe1cTmkD Ky5LSj7lN/asV+pBtfMKl+lMzC6jl87LxFCE38bu/9CBOcKuhFzs1cAMnYRhI0F/YZLFh8 NlRZ1cPCQE1RECqjmGLsaxK83AhE0oyRkGUAqBmn1XbNusKMv2/dXBNh7+eFNWA14AnpMY 5FDPgn6ZWOKwDoWH1PZIL0XBqAwGnCuxhAVCP3w6livLM3Uaqy8iOdu6Bz1CWA== X-Migadu-Spam-Score: -11.19 X-Spam-Score: -11.19 X-Migadu-Queue-Id: 2B687149F4 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="cSxttC7/"; 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-TUID: Vgc5EwK0+gxK Matt writes: > > Matt, maybe you have some ideas about this edge case? > > I have no other ideas within the current ob-shell implementation. As for modifications, I have the following thoughts. > > First, how might we state the problem for this edge case? > > To me, it looks like, "How can the ob-shell :async option manage interactive input?" Do you agree with this formulation? If not, how do you see it differently? It is not about :async per se. Rather about using :session. A simple reproducer is #+begin_src bash :session test mpv "/path/to/some/video" m_ #+end_src Basically, when you send multiline command in comint buffer without waiting for each line to finish, the following line may be read by the running command if that command is interactive. It is similar to a situation when you run a normal terminal like $ mpv "..." $ m_ > One thought is to update :async to work with the :stdin option so that > the block is run as a script. Currently, :stdin runs synchronously in > a separate shell. We might be able to grab the script's output and put > it into the session buffer. See how the following runs in a temporary > shell, regardless of the :session/:async options. Avoiding session altogether will indeed solve the problem, as :session is the place where the problem lies. Adding :stdin support is also an interesting idea, even out of scope of this discussion. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at