mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-16 23:02:45 +08:00
Add a function to complete job PIDs.
This commit is contained in:
parent
bf86a92596
commit
c2c4fbf206
13
share/functions/__fish_complete_job_pids.fish
Normal file
13
share/functions/__fish_complete_job_pids.fish
Normal file
|
@ -0,0 +1,13 @@
|
|||
function __fish_complete_job_pids --description "Print a list of job PIDs and their commands"
|
||||
if set -l jobpids (jobs -p)
|
||||
# when run at the commandline, the first line of output is a header, but
|
||||
# that doesn't seem to be printed when you run jobs in a subshell
|
||||
|
||||
# then we can use the jobs command again to get the corresponding
|
||||
# command to provide as a description for each job PID
|
||||
for jobpid in $jobpids
|
||||
set -l cmd (jobs -c $jobpid)
|
||||
printf "%s\tJob: %s\n" $jobpid $cmd
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user