From 6c4d6415b54b0ddba3c5f95c4a39c8d39c99cf10 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Tue, 18 Aug 2020 11:10:21 -0300 Subject: Add kill command --- lib/App/RunForPid.pm6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/App') diff --git a/lib/App/RunForPid.pm6 b/lib/App/RunForPid.pm6 index a82e530..d1362d8 100644 --- a/lib/App/RunForPid.pm6 +++ b/lib/App/RunForPid.pm6 @@ -47,7 +47,7 @@ sub list-file-descriptors($pid) { #| Find a pid for a window multi sub MAIN() is export(:main) { my $ppid = get-pid; - my @actions = ; + my @actions = ; say "Found pid from a wm: $ppid"; my @process = parse-process-tree($ppid); @@ -67,6 +67,10 @@ multi sub MAIN() is export(:main) { my $fd = choose(list-file-descriptors($pid)) or exit; run 'tail', '-f', "$fd"; } + when 'kill' { + my $signal = choose(Signal::.keys) or exit; + run 'kill', "-{$signal}", $pid; + } when 'stdout'|'stderr'|'stdout&stderr' { my $has-stdout = $option.index('stdout').defined; my $has-stderr = $option.index('stderr').defined; -- cgit v1.2.3-70-g09d2