Skip to content

Commit 10ce003

Browse files
committed
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.
1 parent 563bf4d commit 10ce003

File tree

1 file changed

+4
-1
lines changed
  • Plugins/Flow.Launcher.Plugin.ProcessKiller

1 file changed

+4
-1
lines changed

Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
8181
});
8282
}
8383

84-
if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch))
84+
// When there are multiple results AND all of them are instances of the same executable
85+
// add a quick option to kill them all at the top of the results.
86+
var firstResult = results.FirstOrDefault()?.SubTitle;
87+
if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && results.All(r => r.SubTitle == firstResult))
8588
{
8689
results.Insert(0, new Result()
8790
{

0 commit comments

Comments
 (0)