Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: edit-command-line with spaces in EDITOR
- X-seq: zsh-workers 26147
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: edit-command-line with spaces in EDITOR
- Date: Tue, 16 Dec 2008 23:31:52 +0100
- 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=
- In-reply-to: <20081216214517.GA14544@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20081216153846.GA10426@xxxxxxxx> <237967ef0812160907s6481321dnf796fcdcbb93fb1f@xxxxxxxxxxxxxx> <20081216214517.GA14544@xxxxxxxx>
2008/12/16 Clint Adams <clint@xxxxxxx>:
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author