fix: party list tags the group only when parties differ on it

The tag was shown whenever a party's group differed from
TMUX_PARTY_GROUP, which falls back to 'party' when unset. Since host
time auto-selects the group, a box gating on 'staff' tagged every
line. Compare the visible parties with each other instead.
This commit is contained in:
veg 2026-09-21 09:32:48 +00:00
parent 851cef6941
commit 9b85485ee8
2 changed files with 35 additions and 11 deletions

View file

@ -855,3 +855,20 @@ STUB
run "$PARTY_BIN" detach nobody --party alpha
[ "$status" -eq 0 ]
}
@test "list shows the group tag only when visible parties differ on it" {
"$PARTY_BIN" host solo
run "$PARTY_BIN" list
[ "$status" -eq 0 ]
[[ "$output" == *"solo"* ]]
[[ "$output" != *"[group="* ]]
# A second party gated on another of the caller's groups.
other=$(id -nG | tr ' ' '\n' | grep -vx "$TMUX_PARTY_GROUP" | head -1)
[ -n "$other" ] || skip "caller is in a single group"
"$PARTY_BIN" host duo --group "$other"
run "$PARTY_BIN" list
[ "$status" -eq 0 ]
[[ "$output" == *"solo"*"[group=$TMUX_PARTY_GROUP]"* ]]
[[ "$output" == *"duo"*"[group=$other]"* ]]
}