From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kB7xAK3FHWRshgEASxT56A (envelope-from ) for ; Fri, 24 Mar 2023 16:45:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yEzMAK3FHWRAgwEAauVa8A (envelope-from ) for ; Fri, 24 Mar 2023 16:45:49 +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 C6F4A26337 for ; Fri, 24 Mar 2023 16:45:48 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KkIU8eUL; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679672748; 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=F8LZoLu8RBalYBM1dmOZC2Pisxu8R7OEINnb3rQfdGg=; b=GIsSkPNkk7r6HYl6RZxJGidkKeHZpC2C3jZqKlyZDyw7cqFLcLebWVT2zxU88jwGbaKQeP Gce7a1cg/vob7cOZKjesH0kwn+haR2NppuQXydfnvL3pbTIwiUU4c5peZEyzlu+w/EKiJf XxvDwCcIpCjmdbi/SL4Bv0ojExuByFVdFd1uqYSh/VOJNe4y0BafI9oDSF5ZQUys10FMHq i5iobFr/ZwJibxKk92QRFeFdAxPxZ/51hpDf5/aq1Ca2PmCMX4a5qivkayLCOwpTORkVgb i6rXR5p3e1ejSPJ0UQCzvFlaLJiO8MO8XzSt/1X/JDTwB6EQOFGmgBRYJGQm8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679672748; a=rsa-sha256; cv=none; b=jPq1WdODP2SBnP1z6jhkecIArtwxWidtwFilH2oIuGAL1Ja/kt8g2mBmx4pczvcP6zWCxX ETKZ8KBi4a8IXMZwuKxYSKn7JnwSagdG1n9wGTepa3Md7Qdgt7P78n187Lhwd606A4RJgb izvpCjbDGrSnMPF57icrpp5NbOqJmp0vHyxNf2TqqqiXPlQO23XRMDv82nbq55c7ZD7M1f OYKwGOgQx28k0qVsiq70fQd6bYWVUXwyLypIYZvZZ22ltJLSde/6Aiev8kjHD+06Oj3QAk C1Y7TNkso7jmYnP9Z6pfi4FYfhNCEPUnHLBD4xy+IFFjW3DSepYAkg47j85X1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KkIU8eUL; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pffjw-0007IG-7P; Fri, 24 Mar 2023 07:37:48 -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 1pffjW-0007CS-AP for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 07:37:30 -0400 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 1pffjP-00050z-By for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 07:37:22 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2B44F240193 for ; Fri, 24 Mar 2023 12:37:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679657826; bh=uQ6EYbFJYKzc50Kd7U/ykoYv2K5vwaPfg7iQ4q3uorw=; h=From:To:Cc:Subject:Date:From; b=KkIU8eULXo598ViuCuYMkeLPmHw7R6uRsvrP5L70XBECaFVt+71+G4MptfAGZ3y55 XnEAkgFnWCZ3E0nENhQNbWD1/lVFwF35V0FXxUu2r8WemzNObH7ozfgp7Pi78OvgX+ agNW0AksmsVvwe+VgnAbvCO6X4yPDZSDS4JJoDnHGGKw9RsIWErAwe4wo1SwCSHVtf aVulbGzDSVeXduyw7M+gLYx9QVWEFH2Ij0NCVyJE/ePvOol7DaXQU6jvOzfpMMe9Me bwy1ykXWftjbaYVls3kAnsLXjBvrPvRvC2SnvMwhjCww/a+QovXAj9xWzccH2MfUy+ rvcyaOH0mMJDQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PjgCq4YFsz6tn8; Fri, 24 Mar 2023 12:36:55 +0100 (CET) From: Ihor Radchenko To: Matt Cc: numbchild , emacs-orgmode Subject: Re: Remove "shell" as a supported Babel language within ob-shell.el (was Re: [SUGGESTION] ob-shell async result output should not contains shell prompt) In-Reply-To: <1870f4aeb76.12af86c2f745535.7020028564160040455@excalamus.com> References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87v8kd8zzw.fsf@localhost> <1863472efe9.10fdd5ba4258906.5972264927968042941@excalamus.com> <87y1p7axpe.fsf@localhost> <1870cb30c41.ba75a358545366.6275787333945468963@excalamus.com> <1870f4aeb76.12af86c2f745535.7020028564160040455@excalamus.com> Date: Fri, 24 Mar 2023 11:38:58 +0000 Message-ID: <87h6uaxtt9.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: List-Post: X-Migadu-Queue-Id: C6F4A26337 X-Spam-Score: -8.05 X-Migadu-Spam-Score: -8.05 X-Migadu-Scanner: scn0.migadu.com 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: ToXuRC4tiEOR Matt writes: > What benefit does "shell" provide? > > - The "shell" language allows an arbitrary executable to be run. This means that shells other than those given in `org-babel-shell-names' can be run. People using a non-supported shell could still benefit from ob-shell. > > What downsides does "shell" bring? > > - "shell" falls back to `shell-file-name' which can be an arbitrary executable. Whenever I hear "runs an arbitrary executable", my ears perk up and I start to sweat. There may be security considerations. > - If that executable is a shell, then the prompt gets set independently from Emacs. For the prompt to be filtered from the output, users would need to provide Emacs with the correct regexp. A recent thread discussed creating a header arg to address this: https://list.orgmode.org/87ttzgeg3w.fsf@localhost/ > - We would get bug reports about non-supported shells which kind of work, but have issues because they're not supported > - Maintence associated with supporting arbitrary (shell) executables > > As the current maintainer of ob-shell, I'm in favor of removing "shell" as a Babel language. The cons appear to far outweigh the pros. However, I'm aware others may have good use for it. It's been a part of Org for nearly a decade. I'm sure it's part of people's workflow, especially since it's been in the manual for 6 years. Are there any pros, cons, use-cases, or considerations I've overlooked? I would not see arbitrary executable to be such a big deal. At the end, if SHELL is set to something fishy, the user is likely in serious trouble anyway. SHELL is a part POSIX standard at the end. Yet, the problem with unsupported shells is indeed real. Moreover, "shell" code blocks are currently not portable to different environments. I suggest the following: 1. Introduce a new customization `org-babel-default-shell', defaulting to (or (executable-find "sh") (executable-find "cmd.exe")). 2. Use the value as default shell in "shell" code blocks. 3. Document and announce the change. 4. Create org-lint checker that will mark "shell" code blocks as not desired. The above steps will ensure minimal breakage for existing uses of "shell" blocks. Only users who wrote shell blocks for non-standard shell will have to adapt. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at