From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs Subject: bug#67717: 29.1; Eshell doesn't handle script with "#!/usr/bin/env python3 -ESs" Date: Fri, 8 Dec 2023 16:34:48 -0500 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.71\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25798"; mail-complaints-to="usenet@ciao.gmane.io" To: 67717@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 22:36:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBiW4-0006V3-V3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 22:36:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBiVj-0001fe-Dd; Fri, 08 Dec 2023 16:35:51 -0500 Original-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 1rBiVh-0001f9-DY for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 16:35:49 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBiVh-000079-1W for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 16:35:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBiVt-0005VY-Tp for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 16:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2023 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67717 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170207132621086 (code B ref -1); Fri, 08 Dec 2023 21:36:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Dec 2023 21:35:26 +0000 Original-Received: from localhost ([127.0.0.1]:46368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBiVJ-0005U2-Jt for submit@debbugs.gnu.org; Fri, 08 Dec 2023 16:35:26 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:47682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBiVH-0005Tk-Ih for submit@debbugs.gnu.org; Fri, 08 Dec 2023 16:35:24 -0500 Original-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 1rBiUx-0001Jn-Sy for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 16:35:03 -0500 Original-Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBiUv-0007oP-In for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 16:35:03 -0500 Original-Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-677fba00a49so19929986d6.1 for ; Fri, 08 Dec 2023 13:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1702071299; x=1702676099; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=2AcX4YuWtovIma+t/EaCfuLDLXr+M5wO5wTo3zmmBcI=; b=uLSL0BTGa9BbI6sYIrSY+wxaH9DrV8ib0TeM2TTfioKWcSzs1uedns1djUL9REseKx xQlcg/x6udMhto+YIUiPlyVZ28ITBGwNDcy26YiTyb3pbPCs1fYsk3ZojK1oa3oFbQbO uQClIGRYmpYlzUSBIMNpTr72iA6RlCMGbprg32jOf+gi1EWzz9GR0wRfDh9gdVqoLPwX LLikNovBTudsdrNVhbgfXuPuBbEzdrU8/IosdXZC8mEIngBz7ezILD/V9mfssDQ6I7v3 Lxpp81YSJaqbXk93TZCPHWqt6mX1MIdv8QagxCAERYUGyeAMFVoSEQkziL+lA3Y5+bDZ atLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702071299; x=1702676099; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2AcX4YuWtovIma+t/EaCfuLDLXr+M5wO5wTo3zmmBcI=; b=EZv0LiRSqYJyRZi/FSQWCltBGjaUyVlWRyuABwwMf9Dp4W2dzPWLJCSVYWwQBRvc3m xQDc+hE6ZKEkOQNTMibv5d7hTyOmagxg8XJnVH//0XciFP5ypGOmOLceuYcjv0fO7zxv Dv6pCxpYqWTJ0d+ql7iWw/a4+waWaOCRpr+mkleQQSengtY4/ZaL0kO4wlYmg+hVLqDA sdpLJ1gD1YxykpjLpOLZ97QyuFJoaiMAXcyI8o0XNfQ0CNSt8fKRPokfpfBAtCDiE0Kb MHQNaaCJOsgwAZOKgAFHPozZQEbAGO530vtFvqua1u7qlJLDxncLzqbYasggmUCaV3WU HhpQ== X-Gm-Message-State: AOJu0YwH49AiGc4JURwoKgOKNJcyBzRX7nNPVDOx21Nj01cej75e5FMB G881VrCQpGWC5hSk8laG9va04ryJe1Ytqjf1qFw= X-Google-Smtp-Source: AGHT+IGq5It+3QqabiVCwfPWrm21CEy7+YZPa5yHycJfct6SL5YQJL0X0W1ToN+OKfoqU/2fkdTi2g== X-Received: by 2002:a05:6214:400a:b0:67a:a72d:fbbc with SMTP id kd10-20020a056214400a00b0067aa72dfbbcmr2382616qvb.58.1702071299211; Fri, 08 Dec 2023 13:34:59 -0800 (PST) Original-Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id g5-20020ad45105000000b0067ac80bb33fsm1104631qvp.125.2023.12.08.13.34.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2023 13:34:58 -0800 (PST) X-Mailer: Apple Mail (2.3774.500.71) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=spd@toadstyle.org; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275809 Archived-At: Hi folks, =46rom Eshell, I'm trying to invoke a script with the interpreter line: #!/usr/bin/env python3 -ESs Instead of invoking the script, Eshell prints the line: env: python3 -ESs: No such file or directory Recipe: 1. Create a file with contents: #!/usr/bin/env python3 -ESs from sys import argv print(argv) 2. M-x eshell 3. In Eshell, run the commands: $ chmod +x /path/to/file $ /path/to/file one two three Expectation: Eshell should print the line: ['/path/to/file', 'one', 'two', 'three'] Result: Eshell prints the line: env: python3 -ESs: No such file or directory I think the problem is somewhere in esh-ext.el. Tracing the functions eshell-find-interpreter and eshell-script-interpreter during execution yields the following trace: 1 -> (eshell-find-interpreter "/path/to/file" ("one" "two" "three") nil) | 2 -> (eshell-script-interpreter "/path/to/file") | 2 <- eshell-script-interpreter: ("/usr/bin/env" "python3 -ESs" = "/path/to/file") | 2 -> (eshell-find-interpreter "/usr/bin/env" ("one" "two" "three") t) | 2 <- eshell-find-interpreter: ("/usr/bin/env") 1 <- eshell-find-interpreter: ("/usr/bin/env" "python3 -ESs" = "/path/to/file") It looks like "python3 -ESs" has been parsed as a single argument to env, but it should be split into two arguments. Thanks! In GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2023-08-16 built on armbob.lan Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14 Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=3D-DFD_SETSIZE=3D10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=3Dno' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Eshell Minor modes in effect: shell-dirtrack-mode: t eshell-prompt-mode: t eshell-hist-mode: t eshell-pred-mode: t eshell-cmpl-mode: t eshell-proc-mode: t eshell-arg-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq em-unix em-term term disp-table shell subr-x ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var pcomplete comint ansi-osc ansi-color ring em-basic em-banner em-alias esh-mode eshell esh-cmd generator cl-loaddefs cl-lib esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util files-x rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 57220 7333) (symbols 48 7114 0) (strings 32 20015 1685) (string-bytes 1 653654) (vectors 16 14649) (vector-slots 8 204725 8629) (floats 8 27 19) (intervals 56 289 0) (buffers 984 11))