From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2GHJAXOLV2VKOgAAG6o9tA:P1 (envelope-from ) for ; Fri, 17 Nov 2023 16:49:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2GHJAXOLV2VKOgAAG6o9tA (envelope-from ) for ; Fri, 17 Nov 2023 16:49:07 +0100 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 B25A84046D for ; Fri, 17 Nov 2023 16:49:06 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Qa4MZUiv; 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=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700236146; 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=+NrCQrAprfbfWIn59zY6scXVvPGolrE4E4VPEtt7cto=; b=fmjagtKBdPax4zE9lAsTodIvWUZdlEdwyG0z6X8Gl1ieyDA1kVHObz3Y09oNWKcdo3F7ei EWdF6DWXclvlmcEYgiFLJj36qdCoqpQifw16se7qareWNxOAexHODlzGlJsPwja931e9NO ebOSLpb3vtRUDDZECSt1FiA5J7FEVGjkAEWqBcM5Fdn//9ltQi4Vo4+Rj1mU/mw/mA9RnJ /VK5nMmIFlQ4X42+l0yyBcbb7L2QQj0S25+ASzZQhXBYwzGE/Ja9FzaveqOxyD3GEx07l7 dP75jUlwP0nMPRZ6t1Xfi0lS3W5UQZnriU6a/tfDyJIW0Au37Era4NQsnC+mmw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Qa4MZUiv; 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=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700236146; a=rsa-sha256; cv=none; b=DEe9MgbC+yKAvjAm81LJnkPvpUJe2Br32/cHeQBnX5uJPALGXOrXIslNzLYpF901A0f5/J FUptWtS4xXzfjmCQ2ZB50Mi8LG3qyXwsbxKU5xcxMG+kSPwcCh3zkjPuo2CQj4+3M69R5s eJW1UDC3eJmgWJskrCNS7oiSNW4HZYZCCciMU8+w0bpRHcprK9pb9GAHXURaxsJsINwOFC 9pz04rP1HeHBOpltTMbjEQMc1bgMnFgg2KFPh3lBKNfMFf1ykX8X4KgoU30yyCVXqzVd4Q 50/W2jQbrxtWHXC7aLOKdq0+pUbK0lTxWNB+R3fTGz+2nquldUrQ3DorUWRHMQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r414a-00056C-CN; Fri, 17 Nov 2023 10:48:00 -0500 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 1r414Y-000556-Kc for emacs-orgmode@gnu.org; Fri, 17 Nov 2023 10:47:58 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r414W-0001ld-Mb for emacs-orgmode@gnu.org; Fri, 17 Nov 2023 10:47:58 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40853c639abso16969505e9.0 for ; Fri, 17 Nov 2023 07:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700236075; x=1700840875; darn=gnu.org; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=+NrCQrAprfbfWIn59zY6scXVvPGolrE4E4VPEtt7cto=; b=Qa4MZUiv0/jYfCiOxDaAPx66vxFC864AyI17OVzPSItt/4Tq0WnfYElmGzMhgwUW1M JiKhblo9maqyv2mAKxL1T9SBSVmafg7pWqyCKK7bhN94c8kfEHaEJaIUutu2fdvdJxKP rG63Izz7rCd1ZdpAu/t7lu28hgEW9D+tnwvyRHRm56/KGeGbEZ0mnexMGMFrZj+ND/vJ ttZvPXTSgKTzb0k9UI/oiwk4Pr3eale6vMOKCqKKTbLz0nhCG1sj00KYG+xPcxmC6UHp ygYgPdWGmjeR9sEC+C8+xXNChcmGNyoAzZEHvijwhthSM3fleyrnrX54hrbO71urbZEc 8dIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700236075; x=1700840875; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+NrCQrAprfbfWIn59zY6scXVvPGolrE4E4VPEtt7cto=; b=wMUKWexq02UTH2FhbIBF+9xzF2soyVN1uEcj6X3n7rAl2vNNH6cgKggk0DGyaejumI 1bSS74TM8MQraPsM9H67YLnNXQEHkckVI3CbLdVuXwvmeoxeST6bUhu8xKKUJSTk+wqS j3lIL8xKW9T74ziSHXVJDEbmqs80HWyACQr0PS8XlEc6tOtkXrEK5TGtRoaHPubigPdr Ge0VQoSw07NJD1IK/N9jCFMFVHSTFpaR0EqA65t4Ev0acJikO2VqdtCfHYgSTom3m7oh BIwpVAbsCrCTtV9Yuryi1VuxhwF3aYtgXrsbbuuVVvm52yaSiCu+zDrnbp12hPvO/hwV UJNA== X-Gm-Message-State: AOJu0Ywj0w3EbR3tARwb6T5QCDpnaHFybmPIc2VHmIYvTM3ZZJy3wCJZ vky04kC+qJyaaxC2rE/4vyE= X-Google-Smtp-Source: AGHT+IHyKkWbcGVZ0S6X/kRS6a2GkIXFCwnllxlOQ9OmsIMcKR5/G/r9LXG8AU+mMmgnyTYtRtZUDA== X-Received: by 2002:a05:600c:4f0e:b0:406:5359:769f with SMTP id l14-20020a05600c4f0e00b004065359769fmr16624772wmq.0.1700236074478; Fri, 17 Nov 2023 07:47:54 -0800 (PST) Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id bi27-20020a05600c3d9b00b004097881d5f0sm7573397wmb.29.2023.11.17.07.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:47:53 -0800 (PST) Message-ID: <65578b29.050a0220.8941c.b420@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Fri, 17 Nov 2023 16:47:52 +0100 From: Bruno Barbier To: Ihor Radchenko , Alain.Cochard@unistra.fr Cc: Matt , "emacs-orgmode@gnu.org" Subject: Re: bash source code block: problem after ssh commands In-Reply-To: <87sf54bs61.fsf@localhost> References: <25912.63830.726070.953843@gargle.gargle.HOWL> <87bkcmlor9.fsf@t14.reltub.ca> <87o7gldb78.fsf@localhost> <25914.26693.101108.954656@gargle.gargle.HOWL> <87fs1xbis1.fsf@localhost> <25916.238.191509.652552@gargle.gargle.HOWL> <653f8a93.050a0220.f2202.5816@mx.google.com> <87zfzr2ejj.fsf@localhost> <18ba5e231e3.f989cde147196.3154436412643995109@excalamus.com> <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> <25943.14504.245343.443507@gargle.gargle.HOWL> <87sf54bs61.fsf@localhost> Date: Fri, 17 Nov 2023 16:47:51 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=brubar.cs@gmail.com; helo=mail-wm1-x331.google.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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, 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 X-Migadu-Spam-Score: -7.90 X-Spam-Score: -7.90 X-Migadu-Queue-Id: B25A84046D X-Migadu-Scanner: mx13.migadu.com X-TUID: QiCK51eSnVTn Hi Matt, Ihor, Alain, Ihor Radchenko writes: > Alain.Cochard@unistra.fr writes: > >> At the most basic user level (i.e., non lisp aware), why is it not >> necessarily a bug if "something" does the expected in an X terminal >> but not in an emacs terminal? I think Matt and I (and others) are on >> the same page here, and he already essentially drafted the bug report >> I would have sent (only better). > > WRT M-x shell, feel free to submit a bug report. I mostly pointed that > the problem with M-x shell is not the problem you originally ran to. It > is a different problem (also, we ran into it in the past). FWIW, M-x shell differs from what a plain terminal is doing (xterm, in my case), but, I do prefer 'M-x shell' behavior: it allows me to copy multiple lines, getting the same results as when I type them manually, or copy them line by line. My xterm doesn't seem to allow me to do that. >> What also confuses me is that it seems to me that, in the minimum >> working example, you consider the ssh command and the read command as >> equivalent. But I don't even enter the password when using ssh... I've introduced the 'read' example, as a simpler way to modify the standard input and get the same kind of "unexpected" results, without relying on SSH. It seems that I have only caused confusion, sorry about that. IIUC, the OP example is not working because SSH is modifying the standard input (with or without passwords). > I was only able to reproduce your problem with ssh asking a password. > We are discussing the reproduced case. > > If you see problems with > #+begin_src bash :results output > ssh cochard@fruc.u-strasbg.fr "echo foo>foo_file" > echo "bar" > #+end_src > > even when ssh does not ask for a password, please provide more detailed > reproducer that we can replicate locally without guessing your ssh config. > I'm not the OP, but, my SSH is configured to work without passwords and SSH is still consuming lines from standard input: #+begin_src bash :results output ssh phone echo "remote" echo "local" #+end_src #+RESULTS: : remote It looks like it is a known SSH "feature" (see https://unix.stackexchange.com/a/688024): #+begin_src bash :results output seq 1000000 | (ssh phone sleep 1; wc -l) #+end_src #+RESULTS: : 675173 Same block, but asking SSH to not use stdin (using '-n' as mentionned in this thread): #+begin_src bash :results output seq 1000000 | (ssh -n phone sleep 1; wc -l) #+end_src #+RESULTS: : 1000000 IMHO, what ob-shell is doing today seems a valid way of evaluating source blocks (and it seems to have been like that for a long time). It should probably be documented somewhere, so that users know how to write their source blocks, or switch to another way, like adding a :cmdline parameter as mentionned in this thread. Hoping I didn't increase the confusion again, :-) Bruno > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at