Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

completion ?bug



host configuration: i386-unknown-sysv4.2
zsh-2.6-beta17 invoked as zsh -f		# zle in vi mode

% unsetopt extended_glob
% setopt interactive_comments

% compctl -Q -K joblist kill disown

% joblist()
{
	jobs >& foo
	eval reply=(`procjobs < foo`)	# eval seems necessary
}

% cat procjobs
#! /home/harman/local/bin/perl

# perl 5.001 on i386-unknown-sysv4.2

while (<STDIN>)
{
    chop;			# remove newline
    /\[([0-9]+)\]/;		# get job number   [__]
    $jobno = $1;
    s/\[[0-9]\]* *\+?\-?[ ]*(suspended|running)[ ]*//;
    # removed everything except job names and argv's
    $output = $output."\"%$jobno  #  $_\" ";
    # append to a string
}
chop $output;			# remove the space at the end
print "$output";		# output the concat'ed string

# first test procjobs by doing:
# sleep 1000 & sleep 2000 & sleep 4500 &   # startup some jobs
# satisfy yourself that the output is correct
# joblist; echo $reply[1], $reply[2], ...


Now type kill <TAB>
Observed behaviour is not as expected, please try it out.

Thanks,
-- 
With Warm Regards,
Harmanjit Singh.




Messages sorted by: Reverse Date, Date, Thread, Author