From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 eO7fJ2xzUWRiYgAASxT56A (envelope-from ) for ; Tue, 02 May 2023 22:32:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0JjjJmxzUWQ/5wAAG6o9tA (envelope-from ) for ; Tue, 02 May 2023 22:32:44 +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 4F851388C7 for ; Tue, 2 May 2023 22:32:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptwfF-0005J2-69; Tue, 02 May 2023 16:31:57 -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 1ptwf8-0005Il-6T for emacs-orgmode@gnu.org; Tue, 02 May 2023 16:31:53 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptwf1-0000qn-ML for emacs-orgmode@gnu.org; Tue, 02 May 2023 16:31:46 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1683059498; cv=none; d=zohomail.com; s=zohoarc; b=FzjpVlva1F7El3yK0EYaBrUS9EPolAZmTPo65rr5IiPPoo0rpkxDR2UUM//VxfH+kEu8lLUPmebDiwXOXRdoVGBArSdtmwVclFO5YPkrBpOfuHn4rD7VyhGsNhAvJfd8lAUU2dKNLPn+QWZm/C40UuQO2K00dTOyEUBTg5yaDJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683059498; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=9C+Srs5ANc6fflPOvPP+ikuSuDZ+TIscsjWGwPsgzXU=; b=N0pN+Vv6u3eph6CNUBVKJ3SeoaUZ62G0ajrEsdgujJkZrJI9gPeLVEm/xU+8508fWf3Nubx3nUjz4qO1EXyvtJiDwTSHoGfvb9+ILCQGMkORAKd0s6maJll7eb+eAcWQBmuzCZ0kdpNmAsGpPysI0/MYFZnf+3I1isQ0il4SFKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1683059498; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=9C+Srs5ANc6fflPOvPP+ikuSuDZ+TIscsjWGwPsgzXU=; b=Uccui3QBpi/jFv7M+6Tv8ssLfWuN1+EF7/LZxirrLSIDmrNPy0+om9IE5DGf6J97 SL8cSEiCFxO0ZtFRfy9NFRNcQMJdABmqzorrtxyYF7Cfrlmwz0zHf/DhT3gAlD9PbEy 333ShlZ0AzEoNjw5TZDZnD5ZdjNcxpl7k5Bqsx24= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1683059497107838.565870253434; Tue, 2 May 2023 13:31:37 -0700 (PDT) Date: Tue, 02 May 2023 16:31:37 -0400 From: Matt To: "Ihor Radchenko" Cc: "Org-mode" Message-ID: <187de29d882.c92c2b661216812.7786590004610447376@excalamus.com> In-Reply-To: <877cts8emr.fsf@localhost> References: <87354hs9pz.fsf@localhost> <87mt2oqyup.fsf@localhost> <877cts8emr.fsf@localhost> 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) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Received-SPF: pass client-ip=136.143.188.15; envelope-from=matt@excalamus.com; helo=sender4-op-o15.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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=2; s=key1; d=yhetil.org; t=1683059564; a=rsa-sha256; cv=pass; b=jYWTpdFwlvaPuZcu/+pVc57Ua48Ckrnhoj1dMCdY7ZQ3A6x4eMG/GUyt3BUxBLKJi82m90 JNxEhQs89irwoPkNpYi0REnX0FNsmeOKxFxT1IUS8voW7XmmgIL3FdnUx/0sNS5NgA43A5 eOvbtSaXxgwXwUZG9BgwPXosb47ITayU/xhYa2giAFiJONI9ZOuRHw4bFqAiLu9PYiYvHo j60cy/dFcViyx0LSqPa5wsPolwLhxXP0AGtOxhtyatFN0EV2aUp63+jtThRdYTOXx7kuoj /ae9Deh/E1GBFLAorfwcsXNsFItgGjdzG8fIoxl8wyLtDLdvIoJbPqpo9e7f4Q== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=Uccui3QB; dmarc=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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683059564; 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=9C+Srs5ANc6fflPOvPP+ikuSuDZ+TIscsjWGwPsgzXU=; b=Y0taeKNKWnEZTynj7XgtC82Dps3nLN98dPg78FxZeNwoe2XKpPAqznTvVqMaTXmbWAefGw zLiypFHXptubJtArpki5iyIIBG2zkneLiFCVkWqer4JcNq/yFX05MDKEGnTHzPa24iuL5n dZ/M12tGA3Rsb+6ZDswpmCyphgZCUK0EwPD1m3NMg4nrQfvIp40sN2c9+BHHfn75THrOjJ k5EDE+rGL7KfQ6xkCMZIKfvXVHyKw4B7Q5AURQJZOO1Ryi3olVrb7J9JxmAqKrQDLUM7Gt aNIaADdhr28HLOOs+hrqqvmchSzIUva5vlHnQQBMevbVyt4yZDVLN8Ei3y/pgw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=Uccui3QB; dmarc=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=pass ("zohomail.com:s=zohoarc:i=1") X-Migadu-Spam-Score: -6.89 X-Spam-Score: -6.89 X-Migadu-Queue-Id: 4F851388C7 X-TUID: rEJl2g1h/eZA ---- On Tue, 02 May 2023 00:17:51 -0400 Christopher M. Miles wrote --- > Indeed, this option solved the problem real neat. > I'm surprised by your knowledge and digging problem skill. > I have to say a big TANKS to you. THANKS, THANKS, THANKS. Hahaha My thanks as well to everyone who helped. I'm tied up with personal matters currently and am only seeing this thread now. ---- On Mon, 01 May 2023 07:36:23 -0400 Ihor Radchenko wrote --- > 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? 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? 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. #+name: answers Matt yes #+begin_src sh :stdin answers :results output :session *test* :async echo -n "What's your name?" read -r name echo echo "Hello, $name!" echo -n "Would you like to continue?" read -r continue echo if [ $continue == 'yes' ]; then echo "Continuing..." sleep 3 echo "Process complete" else echo "Aborted" fi #+end_src #+RESULTS: : What's your name? : Hello, Matt! : Would you like to continue? : Continuing... : Process complete