From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8CLPE7Z3gWaGGAAA62LTzQ:P1 (envelope-from ) for ; Sun, 30 Jun 2024 15:20:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 8CLPE7Z3gWaGGAAA62LTzQ (envelope-from ) for ; Sun, 30 Jun 2024 17:20:22 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=JUyLFq0U; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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=1719760822; 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: 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=KzExclzr2sK9FQZYCZ5E2R+U/8nR9NoQ+awb8MMjGsY=; b=B4yldJgtofKIkDpV+ks8a80Xt5u3JN+7rkHFx7OMWpVSOqNYNjSZqicnYzbltzts7Fswkz EIKDOG2eUJhDZ8GXWCjXEcwKzWBROQLuaZtwaAtqz4jbUiQwgwovbH/DbOjxKGekj6hB+l BddzAxbkFKOkOXunq7IaavR2haC1JE10R4SG6LuN4DWaMoW5RSeuAlVzew7kA8UtdEKFB+ 87fY6wbeMMBj0TKWj0SZNygGGX1qUPSYaocYttLSwOBFuhCcc9W8vBmcFRkih9yX+p5Ybp qU01pBVrrrIh5TM90QmicVI3Eqem0RW6vTk3fSatPs+kuPUnFY8Ei7gLVBmAZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719760822; a=rsa-sha256; cv=none; b=E4ZtFUlCyGX5c2SdGT9IXW4gHvCufFjVddULn0NGbZ+/1hcMbd/DAX8C/KtwAbUV12TWS3 asPCLA+Ej619V0eOvKjNCJp00Mo4k9lPPMs978nnMtKpuyIhrnAd3KnLbeslSQNArTxj0y bq1ZYuzerU33xcz4rT9o8jMBUPIysDMmrl/typFnMdIOToAHafh6BcSSua3yja++We0B6p ddzObI1DbrEYIAX27KPZDd9XbBwY64oTbIF962SdH9sRUhORfcnQ8P77aoOFfKm0vKJjPk Fecbu3UaA3PGoY6wh+DsRmWgh3eXfdZBI3vWCBHyw9kiD4+oujfJXd1boSNrhw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=JUyLFq0U; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" 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 223006B86F for ; Sun, 30 Jun 2024 17:20:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNwL0-0000eE-1T; Sun, 30 Jun 2024 11:19:34 -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 1sNwKw-0000dY-Cf for emacs-orgmode@gnu.org; Sun, 30 Jun 2024 11:19:30 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNwKt-00042W-Ae for emacs-orgmode@gnu.org; Sun, 30 Jun 2024 11:19:28 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52e7ad786dfso1933908e87.1 for ; Sun, 30 Jun 2024 08:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719760765; x=1720365565; darn=gnu.org; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=KzExclzr2sK9FQZYCZ5E2R+U/8nR9NoQ+awb8MMjGsY=; b=JUyLFq0USFLOnPLHeknu7kOTu4JZA2RU0DOcDuBeZgGIE2Qukv5Bg5A91iMsrrGCKi C74dqk2ybrO8z5yHE6XiACzZL6nCOD8ANB4xULttfqJ8gn+JuFc50ybWtJVZ2YEACX65 0BkDm6k1TsAS/iZnt1CaNCY1Ee8VHR30Mz/cYrWJ4S35ps8PrY7z/3IECRqQFWO6cciA hlaYBV2VNsVeOl4DjqnU/JuTLIXM8KDyOrmShtjcKM8LW7QgIi/2/8EUXWsQyE9z/szN iWcqWs/TrC3ya1UG7xl2lYEDkQxZaQ2an7O2YUI81a6PH4wzyMxm3XFCoootlpyWwqsy Esdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719760765; x=1720365565; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KzExclzr2sK9FQZYCZ5E2R+U/8nR9NoQ+awb8MMjGsY=; b=Uv8lbyHDzKpP/sKscolNppuT4cBYcYeNUyZxKC8KZ0O39OouiZKlZ2WONg9fUHZpNl IbvvYRJ9USkKz2st8DPBtGQdQJBhv4VXk1ow7oshMqG4QjQPLA/t1HHyOwoo1OofOrqd pb33V9Jc+v63HtOUcOwRbn/Q2gItSbiTzvet3Rug2j5moayGAaCt66IjKuQqRodBJRZS jp2GUqD5Zuv8T6O+N+XsaSQ756ScBsJlsK81LML8rQ/Bn3o4VahjdCnKzN3jU5vLjS7V xRqObnsf5G4FkRhZnkMlJUXP6VDPi72cdHlXtGM786ZHrz3PREVEzwFMuxN3m5pstfyn sOYA== X-Forwarded-Encrypted: i=1; AJvYcCU0PcysoCoR6vf466lxh5VquuHr6PQTyhmSpKHx7irg7Q/9+9TsD7/2BuP0LsswT97k9JkUiPWbsbcK4p/voupQu7nIeI4= X-Gm-Message-State: AOJu0YyJiyFReAnnSTV3eodXcmHQ9mU1OjWgPHj6tdooC1Thp3ENLTyT sWjtzoTBcwjyE8nZs3ptysjzuZGc87xnKNRABEEc/Y8p0o+UQnDZWr6GNqQ+ X-Google-Smtp-Source: AGHT+IGx797r1riUE96o5k3gMqgJBRGoQv6OExIUT3gnANhnE4fkD1uBRiN8eX5fnfSOkTZC8LLflA== X-Received: by 2002:a05:6512:3082:b0:52c:dc06:d4ad with SMTP id 2adb3069b0e04-52e825976e1mr1074292e87.6.1719760765099; Sun, 30 Jun 2024 08:19:25 -0700 (PDT) Received: from [192.168.0.102] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id 2adb3069b0e04-52e7ab0be8esm984825e87.3.2024.06.30.08.19.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Jun 2024 08:19:24 -0700 (PDT) Message-ID: Date: Sun, 30 Jun 2024 22:19:22 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bash source code block: problem after ssh commands To: Ihor Radchenko Cc: Matt , "emacs-orgmode@gnu.org" References: <25912.63830.726070.953843@gargle.gargle.HOWL> <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> <18bdf538f2f.126bad4763316098.8581777358227217138@excalamus.com> <18be3214fb5.c07a71b73414174.856693588849825524@excalamus.com> <87frsu1yhc.fsf@localhost> Content-Language: en-US, ru-RU From: Max Nikulin Mail-Followup-To: Ihor Radchenko , Matt , "emacs-orgmode@gnu.org" In-Reply-To: <87frsu1yhc.fsf@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=manikulin@gmail.com; helo=mail-lf1-x12b.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, RCVD_IN_DNSWL_NONE=-0.0001, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 223006B86F X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.27 X-Spam-Score: -5.27 X-TUID: Ww3v0JZzmCvP On 30/06/2024 18:06, Ihor Radchenko wrote: > Max Nikulin writes: > >> https://debbugs.gnu.org/67259 >> >> Notice that the report is for *interactive* sessions. Org babel sessions >> are not so interactive. They are to maintain state, not to interact with >> users directly... > > You are not right. We have legitimate cases when people can switch to > session buffer, enter commands there, switch back to Org buffers, > send code blocks to the same session, and so on. Timings are still important part of interactive sessions and ob-shell has no chance to simulate them having just block of commands. By the way, dash does not support bracketed paste since it is a minimal shell mainly for interpreting scripts. So result of pasting several commands at once is different from bash. I do not think it is related to dash bugs. >> Possible voluntary decision is to consider every session source block >> similar to "C-x C-e" in bash prompt, so nothing should become implicit >> stdin of commands. Content of a source block should be saved into a >> temporary file then "source /path/to/block_content" command should be >> send to the session buffer. Likely command depends on shell. > > This may work, but we should at least echo the original commands into > session buffer, because users may want to examine them. I have no idea which way bash or readline function edit-and-execute-command is implemented, but commands are echoed when editor is closed. Anyway it may greatly vary across shells. I am unaware if it is possible to detect if bracketed paste is implemented and to send input as bracketed paste. Perhaps some escape sequences are involved. ob-shell might offer variants for sessions: dumb stdin, source a temporary file, or bracketed paste. Anything besides stdin (with its confusing differences from interactive sessions) is almost certainly requires shell-specific code. And `shell' is likely not suitable with its TERM=dumb.