From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21259 invoked from network); 16 Dec 2008 22:32:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Dec 2008 22:32:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 24040 invoked from network); 16 Dec 2008 22:32:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Dec 2008 22:32:15 -0000 Received: (qmail 24283 invoked by alias); 16 Dec 2008 22:32:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26147 Received: (qmail 24272 invoked from network); 16 Dec 2008 22:32:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Dec 2008 22:32:10 -0000 Received: from mail-ew0-f16.google.com (mail-ew0-f16.google.com [209.85.219.16]) by bifrost.dotsrc.org (Postfix) with ESMTP id 08614801E288 for ; Tue, 16 Dec 2008 23:32:06 +0100 (CET) Received: by ewy9 with SMTP id 9so3687904ewy.21 for ; Tue, 16 Dec 2008 14:31:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=dEX7wT3xSbfSAWO6yC/2kUuuigkmlmoMVDKWZWXNHhk=; b=Ja32gXsBsPLV6qnd2EXheVtWRf+x8cobprZs+SGA0F4eMbxPKvwjiKITU0CmNuWiOX swgM/DJbW6kxfssHAs1UupoV83PojHdUMgxfYSojzxunebF192rCdqnDBh6rJ8fKW8Df NPEKvfZ+WAD0sO4pQR6+eCoctN8Bc+dirpNas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=pOaVSTonkRZVpP5gSlhXS8RWw7QdIyk6otkC738qxgC4Z2Ivp0FnUUVORHJGc+Co3r y2CDeVZiVODPOWnyPWlRV2wLiQLMP3wLKxUiu4gt/alKC09t2ChrM0qd8iOC5AfqVzV7 hwGsuuaapg6AB/Vp0HVx2vykwfPScRmQk6mBw= Received: by 10.210.66.13 with SMTP id o13mr9890654eba.105.1229466712478; Tue, 16 Dec 2008 14:31:52 -0800 (PST) Received: by 10.210.82.6 with HTTP; Tue, 16 Dec 2008 14:31:52 -0800 (PST) Message-ID: <237967ef0812161431y39d9b150o66406869d90b1c94@mail.gmail.com> Date: Tue, 16 Dec 2008 23:31:52 +0100 From: "Mikael Magnusson" To: zsh-workers@sunsite.dk Subject: Re: PATCH: edit-command-line with spaces in EDITOR In-Reply-To: <20081216214517.GA14544@scru.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081216153846.GA10426@scru.org> <237967ef0812160907s6481321dnf796fcdcbb93fb1f@mail.gmail.com> <20081216214517.GA14544@scru.org> X-Virus-Scanned: ClamAV 0.92.1/8769/Tue Dec 16 23:17:08 2008 on bifrost X-Virus-Status: Clean 2008/12/16 Clint Adams : > On Tue, Dec 16, 2008 at 06:07:50PM +0100, Mikael Magnusson wrote: >> I'm not convinced this is a good idea. If the binary or path to it >> contains a space, you just broke it. It's probably better to just tell >> people to make a short wrapper script. Also, if some apps parse spaces >> in EDITOR and others don't, then you effectively have to _both_ keep >> the path+binary space-free and not give any arguments. That seems >> suboptimal. FWIW git interprets spaces in EDITOR but... AFAIK it has >> always been the name of a binary and nothing more. > > Are you aware of any applications which _do not_ split EDITOR on spaces > or is this all theoretical? sudo, http://www.google.com/codesearch?hl=en&q=getenv.*EDITOR+show:PzdGoZtAqeI:G9wXYPpcdgc:AfyqUXSwU3U&sa=N&cd=9&ct=rc&cs_p=ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/sudo-1.6.8p9.tar.gz&cs_f=sudo-1.6.8p9/visudo.c tla, http://www.google.com/codesearch?hl=en&q=getenv.*EDITOR+show:6rdpA64V62I:9dG97f3kZF0:vHcDzWcDvPI&sa=N&cd=11&ct=rc&cs_p=http://freshmeat.net/redir/archrevctl/41124/url_tgz/tla-1.3.5.tar.gz&cs_f=tla-1.3.5/src/tla/libarch/editor.c (at this point i would like to note there are a sad number of programs that do sprintf(cmd, "%s '%s'", editor, file); system(cmd);) ironically emacs, % ALTERNATE_EDITOR="ls" emacsclient =emacs emacsclient: can't find socket; have you started the server? To start the server in Emacs, type "M-x server-start". /usr/bin/emacs % ALTERNATE_EDITOR="ls -l" emacsclient =emacs emacsclient: can't find socket; have you started the server? To start the server in Emacs, type "M-x server-start". emacsclient: error executing alternate editor "ls -l" So far, i have only found lots of strange code and programs that do not split EDITOR, I have yet to find one that does (except for git which i already knew about). To be fair, some of the "strange code" does split it, but they also split filenames and run arbitrary code so I don't think those count. pam_unix in osx (i think?), http://www.google.com/codesearch?hl=en&q=getenv.*EDITOR+show:uJDRNZUL70A:waEx2HuwGy4:ADkvXgRqXEk&sa=N&cd=107&ct=rc&cs_p=http://www.opensource.apple.com/darwinsource/tarballs/other/pam_modules-13.tar.gz&cs_f=pam_modules-13/pam_unix/pw_util.c crontab in ditto, http://www.google.com/codesearch?hl=en&q=getenv.*EDITOR+show:_00kONdzoCk:TrU12ZEvJTg:zznBZOnQrgA&sa=N&cd=111&ct=rc&cs_p=http://www.opensource.apple.com/darwinsource/tarballs/other/cron-12.2.tar.gz&cs_f=cron-12.2/crontab/crontab.c here's one that purposely calls system() to split on spaces in EDITOR, http://www.google.com/codesearch?hl=en&q=getenv.*EDITOR+show:X1tmsVlC7-g:7ffgu2ZLT7E:8ZS2TlXP2Xs&sa=N&cd=120&ct=rc&cs_p=ftp://153.19.33.250/software/shadow/shadow-4.0.18.1.tar.bz2&cs_f=shadow-4.0.18.1/src/vipw.c -- Mikael Magnusson