From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id ePk5MSWLgmYjWwEAqHPOHw:P1 (envelope-from ) for ; Mon, 01 Jul 2024 10:55:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ePk5MSWLgmYjWwEAqHPOHw (envelope-from ) for ; Mon, 01 Jul 2024 12:55:33 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719831333; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=P+7LxgQsGPr8ouEy802Tz8Re/ZORYXhTHDuvFN4BrAc=; b=qH0I0nIhIn+Uu5Y+sfdCakiQHZJIF+PqNRGkTfp++Rcb8OrFGLnq48eSVq0TZj/xAD2etD hs+JtooVlUdKiWZfZvERABUUdkPN4T/GYAGt1bR19n/NPboyS520Tvzsvm/FAyYF0uW2Lw 7DKoVIldnndV6H2t3zkY4EkTl0AwxrH0/J0qh7w1+vB9tAh0yMCbWku1J/AHZx2EgTvHQM VF/gY00GmBQywHcJk/zHOCrZOp4XZ+fkbi/7j0mIFaJ/YfiIKaVORKT/L+nAlKGn3F/G8/ zPcFZ54VzQRbrgcOue6AgSOpOKrlixSe7hwZvJxQMj8DAEkC3VVjTBT1YJST5Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719831333; a=rsa-sha256; cv=none; b=WDBdlwN5D7fr4hd1KLEZYy0eGJ7hNZAJvjE+JIYYFn4EDdGEiLvuVXVaHldqz4Q0yGr1mT dwlKVzPJpVUBrfNQgS/RWnxJIHkBmq0SqCauynBQEXwz97HAXwtxny4xeihD4wCtJbIx4z Z+c9y8NNCHWw9EnK6cXq/QtIxAqnlsX1vWAQmWoTXhm2xrfNOdHb9dSn1dqnNNuwL06jOL Mag0qen8TPJ/QwwVBVSPs/blJGD65vIclhtXj0ILt/dIXg1KdIuaaznjqr6NIVOWlGjyyJ 35+MliFwYpZq90wHZ6uvRFuJffGtKzk/F7X07dTrm+L1xRZJy+rM6Q9VT2PPRw== 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 904E750170 for ; Mon, 1 Jul 2024 12:55:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOEg4-0000Ps-B4; Mon, 01 Jul 2024 06:54:32 -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 1sOEg2-0000Pb-8H for emacs-orgmode@gnu.org; Mon, 01 Jul 2024 06:54:30 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOEg0-0000Ez-K6 for emacs-orgmode@gnu.org; Mon, 01 Jul 2024 06:54:29 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1sOEfy-0001YL-CU for emacs-orgmode@gnu.org; Mon, 01 Jul 2024 12:54:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: bash source code block: problem after ssh commands Date: Mon, 1 Jul 2024 17:54:11 +0700 Message-ID: References: <25912.63830.726070.953843@gargle.gargle.HOWL> <875y2e2b9y.fsf@localhost> <18bb07473e2.1007b1565819307.6938164403009000496@excalamus.com> <877cmr2ke4.fsf@localhost> <18bb5337346.dfcd5ebb1139895.801408740607633332@excalamus.com> <18bd3d38ff3.115b786cb2560022.7704006411630399228@excalamus.com> <87fs169h7f.fsf@localhost> <18bd984270d.1048050a22954105.2819987720224062869@excalamus.com> <25942.29051.701153.391260@gargle.gargle.HOWL> <18bd9ea2f7b.b77346232985684.5614027527324280790@excalamus.com> <871qcod9ad.fsf@localhost> <18bdf538f2f.126bad4763316098.8581777358227217138@excalamus.com> <18be3214fb5.c07a71b73414174.856693588849825524@excalamus.com> <87frsu1yhc.fsf@localhost> <87y16m30xf.fsf@localhost> <877ce6l6uy.fsf@localhost> <87tth9ign4.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <87tth9ign4.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , 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 X-Migadu-Queue-Id: 904E750170 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.77 X-Spam-Score: -5.77 X-TUID: jq+wJ3UIJ3r5 On 01/07/2024 16:51, Ihor Radchenko wrote: > Max Nikulin writes: > >> My experience is that it is not easy to start a process without a tty in >> Emacs. Eli will object. > > I guess not on Windows (bug#71081). But otherwise I agree. It was for starting mailcap viewer and Windows was not an issue. > Although, I am not sure what we need to document and what we just need > to rewrite. I have posted it to this thread and to https://debbugs.gnu.org/67259 Some commands try to read standard input if it is available. In interactive sessions it may be hidden due to time interval between typed commands. Be careful when they are used in Org source blocks. [[https://mywiki.wooledge.org/BashFAQ/089][BASH FAQ #89]] warns concerning =ssh= and =ffmpeg=. Either explicitly specify =>file.log' <<"EOF" Added by org-babel EOF #+end_example (Quotes around "EOF" suppress variable expansion in the text.) Tools may have dedicated options, for example =ssh -n= is a more concise way to avoid the pitfall. > In theory, we may work around all the pty-related problems > by simply running a script file (that possibly also echoes its commands > to keep them recorded for user examination). Ideally some kind of bracketed paste should be added to `shell', otherwise it is insecure. However it is not an option for dash. I still have slight hope that implementation of =C-x C-e= might give another idea. Some subtle issues may arise with "source", but perhaps they are more rare than naive ssh usage. If you know how to add text to shell buffer without sending it to the process then you may try. I would leave an option to switch back to "direct" input.