From 10ce003dac6c3b7e86fea41da607e49087422a04 Mon Sep 17 00:00:00 2001 From: Ioannis G Date: Fri, 3 Jul 2020 02:10:41 +0300 Subject: [PATCH] ProcessKiller: change condition for batch kill To avoid killing processes by mistake, only give the option to kill all displayed processes when they are all instances of the same executable. --- Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index e22fad609..d504ce842 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -81,7 +81,10 @@ namespace Flow.Launcher.Plugin.ProcessKiller }); } - if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch)) + // When there are multiple results AND all of them are instances of the same executable + // add a quick option to kill them all at the top of the results. + var firstResult = results.FirstOrDefault()?.SubTitle; + if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && results.All(r => r.SubTitle == firstResult)) { results.Insert(0, new Result() {