[Pkg-zsh-devel] Bug#844710: Bug#844710: autocorrection suggested rm for typing mr without typing "y"

Axel Beckert abe at debian.org
Fri Nov 18 12:00:24 UTC 2016


Control: tag -1 + confirmed
Control: found -1 5.0.7-5
Control: found -1 4.3.17-1

Hi Martin,

Martin Steigerwald wrote:
> ms at 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 at 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.

I was able to reproduce this behaviour on Debian 7 Wheezy, Debian 8
Jessie and Debian Sid.

> 2. Do not autocorrect to dangerous commands.

You might want to have a look at CORRECT_IGNORE in zshall(1).

CORRECT_IGNORE=rm did the trick for me.

> I think this is an upstream issue and would also report it there, if
> it helps.

Thanks for the offer, appreciated. And yes, I also think that is very
likely an upstream issue, so please do. Write an e-mail to
zsh-workers at zsh.org for that.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



More information about the Pkg-zsh-devel mailing list