Package: command-not-found
Version: 0.2.38-3
Severity: normal
Control: affects -1 zsh
Hello,
Under zsh with command-not-found enabled, if you enter a command preceded by a
variable assignment, and that command exits with a non-zero status (whether
because it's missing or because it has finished with an error), then
command-not-found will start looking for the variable assignment as if it
were the missing command.
Here is a simple demonstration ("%" is the shell prompt):
% VAR=value false
VAR=value: command not found
"VAR=value: command not found" is produced by command-not-found, not zsh (if I
replace "false" with "true", I get no output). In this case command-not-found
obviously shouldn't search for anything at all.
Here is a demonstration with a non-existent command:
% VAR=value ttt
zsh: command not found: ttt
VAR=value: command not found
In this case the command is indeed not found, but command-not-found is
searching for the wrong thing. When I type just "ttt", command-not-found finds
a number of candidates.
The expected result is, obviously, that:
1. If a command is valid and exits with a non-zero status, command-not-found
shouldn't look for it at all.
2. If a command is actually not found, command-not-found should look for it
instead of trying to look up the variable assignment as if it were a command.
The version of the package "zsh" is 5.2-3.
This may or may not be related to bug #813331:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813331
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (990, 'testing'), (101, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.4.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages command-not-found depends on:
ii apt-file 3.0
ii lsb-release 9.20160110
ii python-gdbm 2.7.11-2
pn python:any
command-not-found recommends no packages.
command-not-found suggests no packages.
-- no debconf information