If a %n expansion fails, the builtins that support it via the __fish_expand_pid_args hack still run, but typically with the first job instead:
> sleep 50 &
> fg %2 # no second job exists
jobs: No suitable job: %2
Send job 1 (sleep 50 &) to foreground
same with wait, bg and kill - in the latter case it's a bit worse because kill 1 %4 5 will run kill 1, because __fish_expand_pid_args quits at the second argument.
This is easily fixable by doing set -l args (__fish_expand_pid_args); or return in all these.
To be honest I would just add %n job expansion to the remaining builtins (and I don't think a kill builtin would be the worst thing in the world).
If a
%nexpansion fails, the builtins that support it via the__fish_expand_pid_argshack still run, but typically with the first job instead:same with
wait,bgandkill- in the latter case it's a bit worse becausekill 1 %4 5will runkill 1, because__fish_expand_pid_argsquits at the second argument.This is easily fixable by doing
set -l args (__fish_expand_pid_args); or returnin all these.To be honest I would just add %n job expansion to the remaining builtins (and I don't think a kill builtin would be the worst thing in the world).