From: Martin Steigerwald <martin.steigerwald@teamix.de>
To: <zsh-workers@zsh.org>
Cc: <844710@bugs.debian.org>, Axel Beckert <abe@debian.org>
Subject: Fwd: Re: [Pkg-zsh-devel] Bug#844710: autocorrection suggested rm for typing mr without typing "y"
Date: Fri, 18 Nov 2016 14:15:51 +0100 [thread overview]
Message-ID: <3574167.p9ErITdPmY@merkaba> (raw)
Dear Z-Shell developers,
I want to make you aware of the following issue with autocorrection I ran
into:
autocorrection suggested rm for typing mr without typing "y"
https://bugs.debian.org/844710
Axel analysed this below a bit further an indeed, if I press the space bar, I
get this:
ms@merkaba:~> cd /tmp
ms@merkaba:/tmp> LANG=C mr test
zsh: correct 'mr' to 'rm' [nyae]?
rm: cannot remove 'test': No such file or directory
ms@merkaba:/tmp#1>
So two fixes to consider:
1) Don´t confirm on space, as thats to easy to trigger accidentally. :)
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.
Thank you,
Martin
---------- Weitergeleitete Nachricht ----------
Betreff: Re: [Pkg-zsh-devel] Bug#844710: autocorrection suggested rm for
typing mr without typing "y"
Datum: Freitag, 18. November 2016, 13:59:34 CET
Von: Martin Steigerwald <martin.steigerwald@teamix.de>
An: Axel Beckert <abe@debian.org>
Kopie: 844710@bugs.debian.org
Am Freitag, 18. November 2016, 13:00:24 CET schrieben Sie:
> Hi Martin,
>
> Martin Steigerwald wrote:
> > ms@intraws:~/Backup/Mail/Linux> mr kernel-ml_archive.gz
> > kernel-ml_archive_2014-1b.gz zsh: correct 'mr' to 'rm' [nyae]?
> > rm: das Entfernen von „kernel-ml_archive_2014-1b.gz“ ist nicht möglich:
> > Datei oder Verzeichnis nicht gefunden
> >
> > I didn´t type yes, as when I type "y", it is shown on command line:
> >
> > ms@intraws:~/Backup/Mail/Linux#1> LANG=C mr test
> > zsh: correct 'mr' to 'rm' [nyae]? y
> > rm: cannot remove 'test': No such file or directory
> >
> > And I really didn´t type "y" there, I am pretty sure of that, but I may
> > have hit another key by accident.
>
> Indeed scary.
>
> From the output it look to as if "Enter" had been pressed on a
> first glance. But if I press "Enter" (on Sid at least) it shows an "n"
> instead afterwards. (Since I have mr installed, I tested it with "rmm"
> which is only available if nmh or mailutils-mh is installed.)
>
> After some experimenting I noticed that while pressing Enter is
> equivalent to pressing "n" and also prints an "n", pressing the space
> bar is equivalent to "y" _without_ printing a "y".
>
> So you very likely hit the space bar accidentially.
Yikes! Space bar to confirm? And correction to "rm".
Actually what I tried to type was "mv". I obviously wanted to move the file.
But I accidentelly typed "mr". And then, yes, likely the space bar.
I think this deserves a fix in the software :)
Thanks.
-------------------------------------------------------------
--
Martin Steigerwald | Trainer
teamix GmbH
Südwestpark 43
90449 Nürnberg
Tel.: +49 911 30999 55 | Fax: +49 911 30999 99
mail: martin.steigerwald@teamix.de | web: http://www.teamix.de | blog: http://blog.teamix.de
Amtsgericht Nürnberg, HRB 18320 | Geschäftsführer: Oliver Kügow, Richard Müller
teamix Support Hotline: +49 911 30999-112
*** Bitte liken Sie uns auf Facebook: facebook.com/teamix ***
next reply other threads:[~2016-11-18 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 13:15 Martin Steigerwald [this message]
2016-11-19 7:55 ` Bug#844710: " Daniel Shahaf
2016-11-19 11:27 ` Martin Steigerwald
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=3574167.p9ErITdPmY@merkaba \
--to=martin.steigerwald@teamix.de \
--cc=844710@bugs.debian.org \
--cc=abe@debian.org \
--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).