From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 qKizN4vtjGbhWgAAe85BDQ:P1 (envelope-from ) for ; Tue, 09 Jul 2024 07:58:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qKizN4vtjGbhWgAAe85BDQ (envelope-from ) for ; Tue, 09 Jul 2024 09:58:04 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=20240212 header.b=B97YF88F; 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=reject) header.from=7d.nz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720511883; 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:dkim-signature; bh=HgnzIFEeWS11i6Dozjfk3BDHWrY42+ZrsxrXodb0DMM=; b=SXn5SGhWBM/PCGZ+7ESK04UUG4k98IJJalIn7Scf3GgLfhfLJaIFmBnxFabhqBXidg/TqL zx90ds5YqTYUI9VRqIVyolnLTBZf9kAF+K1k6qEjiQjML44mqcAQJeVBE8vOlraNmBtj0M wXbv/U3DR3bOPjvdiAuKh2vzXmif2aCqviFTEyar3iwo8ZaOQASKskDVzIcjPLjSWI5VFY aOlNj3P1fcOqM5l9c186XtVoIrOV7CDn+yu7+C+n/6YhpqPAfeDwVRc6ZCo22AcIB90NjE j2/i1pPK3rvxmJdCzdmz0bsG3SSBg8JKYuADyFGzN6hHmj6/ZdEfUi0ikGBtAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=20240212 header.b=B97YF88F; 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=reject) header.from=7d.nz ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720511883; a=rsa-sha256; cv=none; b=LROlZmWF92dY6un6Fc4uZfpZzgfYhpO1R5MgBprGjmRzE4Iixa7bErKf7e/YDA0zcMnzw5 s9+QSm/vHZ3pt+/D9u26A5d7zinRebO4RAF11BLAWJD9q748xkwqXHlM0NSRoerBiL6gJv zMYzHF3SqMVpuxaAKEtOyPLjZU4+n3iHxAsHk65J8z5mXLXA8MHG3X4B/TULrTE+pcbdmK tzMGgdp6l6Wo8/Z6xQ00DfKjeJxonNg1TAlR8ziVGpDdUkFUJU1FCVAV5vXm3vHC1wmpY+ AkN2z8Cv12bLAl967vOI8/VrWmYlC4EVFS3GFLnPu2G6muYL4aWSTW8mV6fIXQ== 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 6EF26399C0 for ; Tue, 9 Jul 2024 09:58:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR5ig-0001Nn-Ak; Tue, 09 Jul 2024 03:57:02 -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 1sR5id-0001N1-LR for emacs-orgmode@gnu.org; Tue, 09 Jul 2024 03:56:59 -0400 Received: from smtp-8faf.mail.infomaniak.ch ([83.166.143.175]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR5iV-00027l-BF for emacs-orgmode@gnu.org; Tue, 09 Jul 2024 03:56:59 -0400 Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4WJCxQ0Zw7zDFM; Tue, 9 Jul 2024 09:56:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=7d.nz; s=20240212; t=1720511801; bh=HgnzIFEeWS11i6Dozjfk3BDHWrY42+ZrsxrXodb0DMM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=B97YF88FpWC5NedfEG9PCNOXLTiCDIZbeabgGAePlcrlXWHGE2SkpBWqEMFf8fSCA 8i0mpfziDm3BaKvM5QTY9bWVEaXULR315FXTaBgQZCw6/TrMuqkmKESlAHZNim4ur/ HXjKTLtCCt6T4phqQpbmZRHhRD0NTW7BZ9wLpU/Bgl7Xup6a61SXvQvlj+RtMRQOjb p7Tl5Mpyw8yq0uf41nShqi12Nr/C2VMf/uzFVg3RhiH0lz6U8aAmC7TivwgkpTbeFD x5et9W/ytbthHtRtf/Oi9OHp5Ot1DezvtRrUU6pAYHlNxQY7IjKwS6sjGxHoxCcwAp 45jFnwwtNXqkA== Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4WJCxP4splznV6; Tue, 9 Jul 2024 09:56:41 +0200 (CEST) Message-ID: Date: Tue, 9 Jul 2024 09:54:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: org-babel-execute-src-block filters characters from :session *shell* output To: Max Nikulin , emacs-orgmode@gnu.org References: <87ikybk44c.fsf@localhost> <87o782gx7o.fsf@localhost> <87h6dra1ut.fsf@localhost> From: Phil Content-Language: fr In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Infomaniak-Routing: alpha Received-SPF: pass client-ip=83.166.143.175; envelope-from=pe@7d.nz; helo=smtp-8faf.mail.infomaniak.ch 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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 X-Migadu-Queue-Id: 6EF26399C0 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -7.58 X-Spam-Score: -7.58 X-TUID: sqVCwEwH0Ib/ * [2024-07-06 13:36] Max Nikulin: > On 18/06/2024 00:57, Ihor Radchenko wrote: >> Max Nikulin writes: >> >>> Some shells support "semantic shell" that allows terminal applications >>> e.g. to copy whole command output. It is based on escape sequences. >>> https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md >> >> I am looking at this gitlab link, and they way it is implemented is >> simply setting PROMPT in a way that adds these escape sequences to the >> original PROMPT value. > > It does a bit more. There are escape sequences to mark user input, > program output, and to report program exit status. I had in mind support > of this protocol in comint, so Org babel session make take advantage of > it if the feature is available for a specific interpreter. > I imagine it organized in such a way that it can communicate with a program able in the first place to talk natively with std in/out/err, separating input, output, exit/result code and the prompt. By means of escape sequences and a filter, a given shell can talk to that other layer of the protocol. The insertion of escape sequences stays possible with filters for any given shell.