aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/App/RunForPid.pm66
1 files changed, 5 insertions, 1 deletions
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 = <gdb fd stdout stderr stdout&stderr>;
+ my @actions = <kill gdb fd stdout stderr stdout&stderr>;
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;