From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4OykEI4n7mO46gAAbAwnHQ (envelope-from ) for ; Thu, 16 Feb 2023 13:54:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iCnGD44n7mMAUgEAG6o9tA (envelope-from ) for ; Thu, 16 Feb 2023 13:54:38 +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 C7AFE2B157 for ; Thu, 16 Feb 2023 13:54:37 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=a5+1mg0k; 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=1676552078; 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=mHFE48/Dce1U+8DO0Zx4vn/E2fZJCHuqrtzaticjBRo=; b=YMyIzdpgnjnXf8NGmXI/NE7T43GSeyo6OHDbQ/lzYl7b72Mk1XavxE8SGc43atfyIcwVNX GO5ZCE82cUBkgCneA/kUJuCY5q3r624cDwcZIAepIkF8U4LTXG+4DVfpohxdfBQomErAsK pJl1TzikAXtsMQ7aUuUc2o64R/CuadKV3yXdHrEYT47nlokf7wQr87/5aZQragqrCw4YGF wb2dR8mVIOXGC+uebcIwS/1Z/9GoHytRMQLp4LXPdsp2tx3rApQzHCbG7DzQibu/gxpYls TsU78K5eeoc/ZakOpgpZh0fzXmUNiB1TpMi4CjtHNT0lSnWDZhOR1B5LgBltiw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=a5+1mg0k; 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-Seal: i=1; s=key1; d=yhetil.org; t=1676552078; a=rsa-sha256; cv=none; b=bJcesA0Ec0VJzu0SEGV/UBJDoLR3nWezep76Ize7X6epIRV803OhAQV+781v7hC6V34N8Q xfxOHozS23a6nrBy4LfH3a3knwujkIYZoCViIxdDsh3cSwTsU/8SsusQl4gQQYwdvRbS/c hWJ5SKTXwfJRGFqwy627O/JrvjsO+U8Ozu06aVKwtw5pLxO6wvzMnhxYtMEt2JeEF5smQ3 6tvAoUMMpfAOxLeadnFRqzCm8vUbaBQA5a4t9elC0+nadboaFi66OI1ZC5MJxYz/qmZQ9M 4fWY6IuNNm3NWGOlCrjqJYZ6Vnphcm3jKa5lVSY2RphZthOOlSvBA1SU/tzHNw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSdlI-0002NH-0p; Thu, 16 Feb 2023 07:53:20 -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 1pSdlE-0002MC-Jc for emacs-orgmode@gnu.org; Thu, 16 Feb 2023 07:53:17 -0500 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 1pSdlC-0005MP-Do for emacs-orgmode@gnu.org; Thu, 16 Feb 2023 07:53:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E8F77240480 for ; Thu, 16 Feb 2023 13:53:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1676551991; bh=C6wxSDvxKt01la1FBYecyMw0muZUBaycQcdcw3CAAnw=; h=From:To:Cc:Subject:Date:From; b=a5+1mg0k1gfjQJQeW9ks+tJbCMIziQGjRmDsQUnhRVikVM2WNYvpm39IYTRzQYTMw RMSo5RyUy61B9LomXMT/65WC9BiWJPMrPxhhQXFCuno+MS6B9YgJnIGceL2wITRY9E WTBLXmOM4pLqadCFJVETB/LzSuhZbQYLWYhTzoIql3uI2h3K2r1zxGfLQyF/Abt5CM 9mgZL1J1Pcutn+nt4vQ0DWvsWpY1pPIqsF0DtN2vN34QcQEFwXHEDRICO0lKKOGUQs uNdWOEkJhDv2jnJci2iy9MndUS8L+CdeOpHTuqcmq7mLDmxA+6vEx/FTR8bbHayldH kyMN8qOj/sqtA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PHZcQ5Yk0z6tnx; Thu, 16 Feb 2023 13:53:10 +0100 (CET) From: Ihor Radchenko To: Jack Kamm Cc: Matt , emacs-orgmode Subject: Re: [BUG] shell sessions started outside of Babel broken In-Reply-To: <87wn4j1mee.fsf@gmail.com> References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87a61j3orj.fsf@gmail.com> <1864701b4b8.e37160d6373275.4308190093579612690@excalamus.com> <87357a2r27.fsf@gmail.com> <1864bbf632d.acf83486624816.5548943856411522610@excalamus.com> <87wn4j1mee.fsf@gmail.com> Date: Thu, 16 Feb 2023 12:53:48 +0000 Message-ID: <875yc1wz37.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 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: X-Migadu-Queue-Id: C7AFE2B157 X-Spam-Score: -9.39 X-Migadu-Spam-Score: -9.39 X-Migadu-Scanner: scn0.migadu.com 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-TUID: iGVJ18kqT6pT Jack Kamm writes: > In particular here's the output I get now for: > > 0. emacs -Q -L ~/src/org-mode/lisp > 1. M-x shell > 2. Call `org-ctrl-c-ctrl-c' on the following block in a separate Org buffer: > > #+begin_src sh :session *shell* > echo hello world! > #+end_src > > #+RESULTS: > | hello | world! | > | | | > | org_babel_sh_eoe | | > > So, ob-shell mostly works, but the result is a bit mangled with the > eoe token leaking through. This might not be a new bug, my memory is > that ob-shell sessions has long had problems with leaky results. This example is mostly an implementation detail of Org babel. Org babel assumes that session buffer name is the same as session name and also assumes that session is properly initialized if that buffer exists. In the example above, you manually create *shell* buffer and Org believes that it is properly initialized, making certain assumptions. The assumptions do not hold in that manually created buffer. I am not sure if we need to do something about this situation. I guess, we may set some buffer-local variable in actual Org babel buffers and then make `org-babel-comint-buffer-livep' check that buffer-local variable to distinguish Org-created buffers from manually created. But I do not see this as a big problem. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at