Zsh Mailing List Archive
Messages sorted by:
Re: rfc patch, abort rm instead of only removing the * from the cmdline
- X-seq: zsh-users 13149
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: rfc patch, abort rm instead of only removing the * from the cmdline
- Date: Sun, 17 Aug 2008 13:42:15 -0700
- In-reply-to: <237967ef0808151649j1d14ce23s1acad02da98fdfdf@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0808151649j1d14ce23s1acad02da98fdfdf@xxxxxxxxxxxxxx> <2d460de70808160858p5312805dlf1c9976a9b702a51@xxxxxxxxxxxxxx> <237967ef0808160902p4dbc6d73w6620f6c69471ea20@xxxxxxxxxxxxxx> <2d460de70808160914h2c3706ebs312a0bbd62afbf57@xxxxxxxxxxxxxx> <20080816205209.GA5176@xxxxxxxxxxxxxxx> <237967ef0808161358y5deae840xe3bd399d01d198f@xxxxxxxxxxxxxx> <20080817065717.GA5175@xxxxxxxxxxxxxxx>
On Aug 16, 1:49am, Mikael Magnusson wrote:
} It surprised me that this isn't already what happens, what do others think?
} Imagine for example the typo
} % rm -rf * /tmp
} Before, even if you said no to the prompt, it will remove all your
} files in /tmp.
On Aug 16, 6:14pm, Richard Hartmann wrote:
} Agree 100%! This must be changed asap!
} As Peter is on holidays, can Bart chip in on this?
It having been this way for far more than a decade without anyone ever
complaining before, I'm not sure "asap!" really applies.
The existing behavior really is what Paul Falstad wanted the shell to
do, all those years ago. Like several of the very oldest features,
it's rather woefully under-documented in the man pages. If you want
to abort the whole command, you're supposed to interrupt it with ^C,
not answer "n" -- the prompt is really just to give you an extra moment
to think about what a stupid thing you might be about to do, not to
second-guess your entire command line; compare the RM_STAR_WAIT option
(which is a lot more recent).
That said, if it were going to be changed, Stephane's patch is better.
Ideally I suppose this prompt should work like the prompt for "correct",
giving you "nyae" as choices so you can choose to abort or to edit your
typo. Then it would be more obvious that "n" was not going to entirely
whack the command.
Messages sorted by: