From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7344 invoked from network); 5 Sep 2022 09:21:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Sep 2022 09:21:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662369665; b=pY7EAlwD+/CiZVPoXFdEws05ayQnC72FO4zRWS5//Ts2SlqiVOtdEnr8KovywuPlkSmRHN21P4 njMnGpePt/HpW+9hfyptAnJzCLO9yC/mTNYvAtueslhCifdeumIYbvnm/P90eLgLYpHrPw1ZLq GkhSlHsTlQpVmWr3I4wFLFWDgL7nBbmUl3SmxFl3x3h0j+IjeUwbFuQOK+uSdzX6W4Hd3uGyHn T3PQKwIcO4/15SvO4XD/CPSCtO6VIIrNoNJt1ZHdbb9+37UbS94QNEwmGV5RviKMDleK5lMCYp Gu/a/Achml5GNa6CTUsIUtIORX/5LanJ/PZvEG5R34VHDQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1662369665; bh=B8JSxmlnIeRChpiHKT8u4GMZeuEeZO7opbCdmgxAEI4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=mDutxGWmxjGl+fuR9tTNwQuDoQv1+tuoGxB6l1COC8HiLDU1nb6II2NSVMvvERa/Lrz5uQateU Fdd+sG6QySoSUep6dIbQrQZbA+EkG0WNm5j9zj9BPdklei99mbyYau7s2d8QCK5aisKPCaPauU Y/hUGxteFgT17FyX3GEcD7DDvNJ3BmL5WOeQOyTPoednK8EpEqX47wTm5va/4M5F2Sr4VYy/Eh 2NWEO/bFKp7O5eXJydKKrjTRjgPisuXlKILhGebSt6nGBjQIvaAr/ZN7Y5yMqGIdbC7AFfVVID XvZyBS+fQQouF3lyU06qJ9/VbUJtU7oHZBWhmQDrNB0D0g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZWNKiaoyzm8tLR3LtmFvQPfRJMfZzmYF2tKk1y5rTLM=; b=UmnNW/8NcLfS0WOLTsdwOlbNi5 9Mb4V2Sa7f2GMCA1HZzJ/MGxPQjHjeIm9WciO2R9JKkzrMdo5qxSKxW0VZ8a3XUqiPq8+OdJMvHV4 nk3FXaz3zNWMQFv27uNc9++QwlTcFLveYEH34fhpjLaRFkF4xClXjJVFzbDej7w1laTJy+zmG9BkU 4jLDi+2xqKaXtb7MeFkwyxHzqKRVJFnCAjohjKdNoCIS4XHNAXvOSiPqAIW3E1ioQhTxYUuAGF6zG 7+568ckiyPw7VnE6/PzOnBfYmFOYr+cj7g/R63nOkA29d/xeFKVA8sEt9OG8f13ipfHKu8D75OGh2 QrY/helg==; Received: from authenticated user by zero.zsh.org with local id 1oV8Hx-000Cex-2U; Mon, 05 Sep 2022 09:21:05 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:40186) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oV8Ca-000CDv-PP; Mon, 05 Sep 2022 09:15:33 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 764E3328; Mon, 5 Sep 2022 11:15:32 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 3F47F28001DE; Mon, 5 Sep 2022 11:15:32 +0200 (CEST) Date: Mon, 5 Sep 2022 11:15:32 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: ${EDITOR} with spaces (was: Re: [PATCH] initialization of main keymap) Message-ID: <20220905091532.GB255763@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20220901002300.GD992100@zira.vinc17.org> <20220901012122.GA1046913@zira.vinc17.org> <20220902000406.GB1046913@zira.vinc17.org> <20220902131533.GC255755@cventin.lip.ens-lyon.fr> <20220904094216.GV5920@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.7+37 (a90f69b9) vl-149028 (2022-09-02) X-Seq: 50605 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2022-09-04 12:48:20 +0200, Mikael Magnusson wrote: > On 9/4/22, Daniel Shahaf wrote: > > Vincent Lefevre wrote on Fri, Sep 02, 2022 at 15:15:33 +0200: > >> Yes, the current behavior (with or without the patch) is definitely > >> incorrect. For instance, https://unix.stackexchange.com/a/4861/74516 > >> suggests to set VISUAL to the full-screen editor, and either leave > >> EDITOR unset or set it to "vi -e" (just in case a special line mode > >> would be needed in some context). So a user who would use VISUAL=emacs > >> and EDITOR="vi -e" would probably be annoyed by the current behavior. > > > > Is $EDITOR meant to be used in a system(3) manner, as «system("${EDITOR} > > ${(q-)filename}")», > > or in an execve(2) manner, as «execl($EDITOR, $EDITOR, $filename)»? > > (plus or minus a «--» guard in both cases) > > In practice, if you want $EDITOR to contain options to your editor, > you have to make a wrapper script and put it in a path without spaces, > because programs all assume different answers to your question. Indeed, for EDITOR, under "mailx", POSIX says "name of a utility" and not "command". This is a bit unclear about the possibility of full pathnames, but under "more", POSIX says "If the last pathname component in EDITOR is either vi or ex, [...]" so it is now clear that EDITOR may contain a full pathname (there wasn't any practical reason for a restriction). For VISUAL, POSIX says "pathname of a utility". So, in both cases, options should not be accepted, i.e. spaces should be regarded as part of the name (though I wonder whether this is portable in practice). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)