fix: reject '.' and leading '-' in party names
tmux session_check_name() silently rewrites '.' to '_', so a dotted party name desyncs from its tmux session and every -t lookup fails (verified on tmux 3.3a through 3.6b). Leading-dash names can never be addressed through the CLI parsers.
This commit is contained in:
parent
a4e6dbe672
commit
f06c599ea7
2 changed files with 37 additions and 17 deletions
|
|
@ -42,6 +42,21 @@ setup() {
|
|||
done
|
||||
}
|
||||
|
||||
@test "validate_party_name rejects dots (tmux rewrites '.' in session names)" {
|
||||
# tmux session_check_name() silently maps '.' and ':' to '_', so a
|
||||
# dotted party name desyncs from its tmux session and every later
|
||||
# `-t <name>` target fails. Verified on tmux 3.3a through 3.6b.
|
||||
for bad in "my.party" "." ".." "a.d"; do
|
||||
run validate_party_name "$bad"
|
||||
[ "$status" -ne 0 ] || { echo "should have rejected: $bad"; false; }
|
||||
done
|
||||
}
|
||||
|
||||
@test "validate_party_name rejects leading dash (unusable through the CLI)" {
|
||||
run validate_party_name "-flag"
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
|
||||
# time
|
||||
# ====
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue