From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org alters output of bash code blocks when run with :session Date: Wed, 14 Mar 2018 14:51:19 +0100 Message-ID: <871sgmn4tk.fsf@nicolasgoaziou.fr> References: <1519251001.2394682.1278948176.74D79AA2@webmail.messagingengine.com> <87bmgcyrjp.fsf@nicolasgoaziou.fr> <1520961890.1938027.1301766872.58CEC7F1@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ew6oR-0007KT-Uj for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 09:51:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ew6oO-0004FW-13 for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 09:51:28 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:58595) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ew6oN-0004F4-QG for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 09:51:23 -0400 In-Reply-To: <1520961890.1938027.1301766872.58CEC7F1@webmail.messagingengine.com> (Tyler Smith's message of "Tue, 13 Mar 2018 13:24:50 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Tyler Smith Cc: Emacs Org-Mode Help Hello, Tyler Smith writes: > I can't see any straightforward way to modify ob-shell sessions > without also changing regular shell-mode. So I wonder if the easiest > way to address this would be to create a new mode derived from > shell-mode, ('ob-shell-mode')? That would give us a way to modify the > prompt code inside babel without interfering with shell-mode. Creating a new mode doesn't sound like the easiest way. What about the following suggestion, from a link I posted in this thread: Thanks for the examples. Anything goes, of course, but I'm hoping for a tighter integration. Maybe a :prompt param to sh source blocks, which sets the prompt in a session, and which also manipulates `comint-prompt-regexp' or `shell-prompt-pattern' local in the session buffer. Or a mechanism like in Tramp, where the shell prompt is set to a random string not expected in the shell (see `tramp-end-of-output'), and `comint-prompt-regexp' or `shell-prompt-pattern' are adapted automatically local in the session buffer. Regards, -- Nicolas Goaziou 0x80A93738