diff --git a/share/config.fish b/share/config.fish index c726ec8e9..afa2510f6 100644 --- a/share/config.fish +++ b/share/config.fish @@ -223,18 +223,21 @@ end for jobbltn in bg wait disown function $jobbltn -V jobbltn - builtin $jobbltn (__fish_expand_pid_args $argv) + set -l args (__fish_expand_pid_args $argv) + and builtin $jobbltn $args end end function fg - builtin fg (__fish_expand_pid_args $argv)[-1] + set -l args (__fish_expand_pid_args $argv) + and builtin fg $args[-1] end if command -q kill # Only define this if something to wrap exists # this allows a nice "commad not found" error to be triggered. function kill - command kill (__fish_expand_pid_args $argv) + set -l args (__fish_expand_pid_args $argv) + and command kill $args end end diff --git a/tests/pexpects/wait.py b/tests/pexpects/wait.py index ba0cf2607..3dc21fc62 100644 --- a/tests/pexpects/wait.py +++ b/tests/pexpects/wait.py @@ -125,3 +125,11 @@ sendline("wait 1") expect_prompt("wait: Could not find a job with process id '1'") sendline("wait hoge") expect_prompt("wait: Could not find child processes with the name 'hoge'") + +# See that we don't wait if job expansion fails +sendline("sleep 5m &") +expect_prompt() +sendline("wait %5") +expect_prompt("jobs: No suitable job: %5") +sendline("kill %1") +expect_prompt()