mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 12:11:20 -03:00
config.fish: lazy load job control functions
These don't really belong in config.fish. Put them in function files, like similar wrappers. The redundancy is ugly but if it's a problem we can use code generation to fix that.
This commit is contained in:
@@ -143,26 +143,6 @@ end
|
||||
# PATH is possibly set above.
|
||||
__fish_reconstruct_path
|
||||
|
||||
for jobbltn in bg wait disown
|
||||
function $jobbltn -V jobbltn
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and builtin $jobbltn $args
|
||||
end
|
||||
end
|
||||
function fg
|
||||
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 "command not found" error to be triggered.
|
||||
function kill
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and command kill $args
|
||||
end
|
||||
end
|
||||
|
||||
if status is-interactive
|
||||
__fish_migrate
|
||||
end
|
||||
|
||||
5
share/functions/bg.fish
Normal file
5
share/functions/bg.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
# localization: tier1
|
||||
function bg
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and builtin bg $args
|
||||
end
|
||||
5
share/functions/disown.fish
Normal file
5
share/functions/disown.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
# localization: tier1
|
||||
function wait
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and builtin wait $args
|
||||
end
|
||||
5
share/functions/fg.fish
Normal file
5
share/functions/fg.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
# localization: tier1
|
||||
function fg
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and builtin fg $args[-1]
|
||||
end
|
||||
9
share/functions/kill.fish
Normal file
9
share/functions/kill.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
# localization: tier1
|
||||
if command -q kill
|
||||
# Only define this if something to wrap exists
|
||||
# this allows a nice "command not found" error to be triggered.
|
||||
function kill
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and command kill $args
|
||||
end
|
||||
end
|
||||
5
share/functions/wait.fish
Normal file
5
share/functions/wait.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
# localization: tier1
|
||||
function wait
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and builtin wait $args
|
||||
end
|
||||
@@ -5,7 +5,7 @@ fg (math 2 ^ 31 - 1)
|
||||
|
||||
fg (math 2 ^ 31)
|
||||
# CHECKERR: fg: '2147483648' is not a valid process ID
|
||||
# CHECKERR: {{.*}}config.fish (line {{\d+}}):
|
||||
# CHECKERR: {{.*}}/fg.fish (line {{\d+}}):
|
||||
# CHECKERR: and builtin fg $args[-1]
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: in function 'fg' with arguments '2147483648'
|
||||
|
||||
Reference in New Issue
Block a user