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 mDeuLAtY82N/VwAAbAwnHQ (envelope-from ) for ; Mon, 20 Feb 2023 12:22:51 +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 yL6xKwtY82MA5gAAG6o9tA (envelope-from ) for ; Mon, 20 Feb 2023 12:22:51 +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 5E1341D511 for ; Mon, 20 Feb 2023 12:22:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU4F5-0001vL-0k; Mon, 20 Feb 2023 06:21:59 -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 1pU4F2-0001tj-F0 for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 06:21:56 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU4F0-0008Kb-2E for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 06:21:56 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1F10724019C for ; Mon, 20 Feb 2023 12:21:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1676892111; bh=Bc0unXFMAlPWR4MFzs70S6DYCkU3m4q9LlrDVw/GrUI=; h=From:To:Cc:Subject:Date:From; b=Q11T5iI5dhuZG50FydHHpzM6v8QvdlX8IsAv81C6tkD43/x8K1UETNWUFxsX37pLl 0lEYSCI5B5ZdzXm/rLUvBX2n3Z1VxX3tjZXzI4BiyP1GC46FYGMtmQeMKrsuPpuExx 077Znj68Tvju6xuX8wm6Xqa5zxR0B5R94Q457pPrPvGqn9wyWLwiv7BtJIMouMr/yJ I/j6vlDwAnUcv0ouEt/91Rpg9uSlF3ddQvM1r+equ/BI/lyZnzONbVf844XUToj8pb EMDTZ7+L/VCU42hSr4vWkfoQW5JnGZYwUyltQCIKQGdx+fuuPHd9B1OcAN0oFyTPBO zHBgN8SdpR8mg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PL0P74pCrz6ts3; Mon, 20 Feb 2023 12:21:47 +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: <87ttzhy9vm.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> <875yc1wz37.fsf@localhost> <87ttzhy9vm.fsf@gmail.com> Date: Mon, 20 Feb 2023 11:22:27 +0000 Message-ID: <87ttzgeg3w.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, 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: 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676892171; 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=EMMHtM4L3D3QV1Xa1lr53G4dsLzJ3eNJIdwHn75diBw=; b=cczccfWJL+FXExn1tACWnCKonsWqADXuyeEfM0hbMsDfJ0EuSaSlmX2f6/Wc0di21iPt8y HZeTyPavKbO3AjC/9f4Xeexcm0D6SkcKY+qSaIE/FPR6t/gV5ZU93MtSyHUTtcMDnKvkXf lzJR4kQE9juMTA1Q3R20boOxW6oXx4OONP21iQjvP+qqQw741HYRMruBTpCcKh9bSQDKTK sHdqj0kc/t2yk1F7H5oMQJxVyMW+sY+bq9NXFTyVD6z4uGL2KYtwW8odYIJDNr3VqJCVsf mPx49vcnZpxOA9RWwA9w842Kq0SSPi2eBesmVIGgcPMfs4NEv0ubHY6CU2zDHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Q11T5iI5; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676892171; a=rsa-sha256; cv=none; b=LBJ9ry6ekQ5ZNvq/kxOJnCGQpZ7voLFg3PsTkVrcRqz4vDT8iTt6JWOAnB2EOR73x7QLp/ jCowqoPrQdQieIX04izAldeukNOXDjzbzfbGg23VR71uhcxyii31IqlYoFlKoG8bJt6cge dadOXJLigsrsVrxAg09zD5VNkV03ul1P/+D/k8PRCYuMMHSnaDYnJWN3uTMrOeD93MCGAB DWKRApuEGwe3ZQFb0hfj/4Nsdz/YQzTqrokkxN6lFFCcD3BOkKmC7IQXWGnTFV9+fQ2B3v XMwlzxqkkixDszXP4XNpWCl6VuiGRvVf3ecLrRNX1YXJESwpYJorRAl+XDY1Fw== X-Migadu-Spam-Score: -6.13 X-Spam-Score: -6.13 X-Migadu-Queue-Id: 5E1341D511 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Q11T5iI5; 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=posteo.net X-TUID: oKbjMLlBsKJp Jack Kamm writes: > Ihor Radchenko writes: > >> Org babel assumes ... session is properly initialized if that buffer >> exists. > ... > Having the extra flexibility to start the session manually can be > handy. For example, conda is currently broken with ob-shell sessions (as > discussed in this thread), but not M-x shell sessions, so it provides a > useful workaround. Makes sense. In fact, ob-core does define a number of interactive functions to work with sessions manually: - `org-babel-load-in-session' - `org-babel-initiate-session' - `org-babel-switch-to-session' - `org-babel-switch-to-session-with-code' What is confusing is that `org-babel-execute-src-block' does not use generic `org-babel-initiate-session'. As for ob-shell, ssh/conda not working are because they change the prompt. And the fact that default Emacs' heuristic regexp to search for prompts is accidentally matching the prompt in ssh/conda is just a co-incidence. The default Emacs' heuristics, on the other hand, never matches multi-line prompts. So, the current approach is more reliable for "true" shell source blocks. We may, however, allow an extra header arg to set the prompt regexp manually. Would it make sense? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at