From 614e238a242d2c744bfa1e045de75e6428b12ff9 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 9 Sep 2026 02:50:32 +0000 Subject: [PATCH] fix(settings-hook): list-items --owned-by with --command-regex intersects When both filters are given, an item must satisfy both: owned by the requested source AND matching the pattern. Before, the regex branch skipped every owned row, so the combination could never match. Co-Authored-By: Claude Fable 5.1 --- bin/gstack-settings-hook | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/gstack-settings-hook b/bin/gstack-settings-hook index 7c963b24b..b755752f9 100755 --- a/bin/gstack-settings-hook +++ b/bin/gstack-settings-hook @@ -886,7 +886,11 @@ case "$ACTION" in if (!cmd) continue; const row = gsOwnedRow(cmd, event, entry.matcher || ""); if (ownedBy && (!row || row.source !== ownedBy)) continue; - if (re && (row || !re.test(cmd))) continue; // the regex only ever sees items no table row owns + // Alone, the regex only ever sees items no table row owns (the + // vendor-own probe). Combined with --owned-by it narrows THAT set: + // filters intersect, a regex never widens a selection. + if (re && !ownedBy && row) continue; + if (re && !re.test(cmd)) continue; console.log(JSON.stringify(cmd)); } }