zsh-workers
 help / color / mirror / code / Atom feed
From: Martin Steigerwald <martin@lichtvoll.de>
To: 844710@bugs.debian.org, Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Martin Steigerwald <martin.steigerwald@teamix.de>,
	zsh-workers@zsh.org, Axel Beckert <abe@debian.org>
Subject: Re: Bug#844710: Fwd: Re: [Pkg-zsh-devel] Bug#844710: autocorrection suggested rm for typing mr without typing "y"
Date: Sat, 19 Nov 2016 12:27:12 +0100	[thread overview]
Message-ID: <7714408.9UiMmvpNuW@merkaba> (raw)
In-Reply-To: <20161119075542.GA6750@fujitsu.shahaf.local2>

Am Samstag, 19. November 2016, 07:55:42 CET schrieb Daniel Shahaf:
> Martin Steigerwald wrote on Fri, Nov 18, 2016 at 14:15:51 +0100:
> > So two fixes to consider:
> > 
> > 1) Don´t confirm on space, as thats to easy to trigger accidentally. :)
> 
> The code confirms on both tabs (since commit 7f1ce570) and spaces (since
> before CVS).  Does anyone know a reason for doing this?
> 
> The patch also downscopes a couple of local variables, with no
> functional change.
[…]
> On a tangent: what do "nyae" mean?  I couldn't find the answer in the
> manual.

I thought about this as well.

> > 2) Don´t autocorrect to dangerous commands like "rm". Could be a bit
> > challenging to make a list of commands which are dangerous and can easily
> > trigger unwanted actions. "rm" would IMO definately be one of this, while
> > with "dd" it would be harder to trigger an unwanted action by accident
> > due to syntax requirements.
> > 
> > Axel made me aware that I tell Z-Shell to ignore dangerous commands with
> > CORRECT_IGNORE=rm, but I think it would be good to reconsider the standard
> > behavior.
> 
> Well, it _does_ prompt the user asking whether "rm" is correct.  Isn't
> that sufficient?

Well, I meant the last sentence "I think it would be good to reconsider the 
standard behavior" generally to both of the above items. The current 
combination of 1) and 2) invites accepting dangerous autocorrections 
accidentally. It may be enough to change 1) or 2). 

That written, on other occassions Z-Shell protects the user from accidentally 
triggering potentially dangerous operations as well:

Z-Shell:

martin@merkaba:/tmp/test/test2> echo LANG=C rm -rf .*
LANG=C rm -rf .*
martin@merkaba:/tmp/test/test2> LANG=C rm -rf .*

Bash:

martin@merkaba:/tmp/test/test2> bash
martin@merkaba:/tmp/test/test2 -> echo LANG=C rm -rf .*
LANG=C rm -rf . ..
martin@merkaba:/tmp/test/test2 -> LANG=C rm -rf .*
rm: refusing to remove '.' or '..' directory: skipping '.'
rm: refusing to remove '.' or '..' directory: skipping '..'

(Actually I am glad that coreutils rm -rf skips these meanwhile too. And also 
refused to do rm -rf / unless a special option is given.)

Thank you,
-- 
Martin


  reply	other threads:[~2016-11-19 11:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 13:15 Martin Steigerwald
2016-11-19  7:55 ` Bug#844710: " Daniel Shahaf
2016-11-19 11:27   ` Martin Steigerwald [this message]
2016-11-19 11:46     ` Frank Terbeck
2016-11-19 12:21       ` Daniel Shahaf
2016-11-19 18:00   ` Bart Schaefer
2016-11-19 21:54     ` Daniel Shahaf
2016-11-20 19:22       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7714408.9UiMmvpNuW@merkaba \
    --to=martin@lichtvoll.de \
    --cc=844710@bugs.debian.org \
    --cc=abe@debian.org \
    --cc=d.s@daniel.shahaf.name \
    --cc=martin.steigerwald@teamix.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).