Only forbid #( in names and titles (styles are #[ and are useful).

This commit is contained in:
nicm
2026-06-28 15:53:18 +00:00
committed by Nicholas Marriott
parent 6c2ef75681
commit 4e612612dc

5
tmux.c
View File

@@ -290,7 +290,10 @@ clean_name(const char *name, const char* forbid)
return (NULL);
copy = xstrdup(name);
for (cp = copy; *cp != '\0'; cp++) {
if (strchr(forbid, *cp) != NULL)
if (*cp == '#' && strchr(forbid, '#') != NULL) {
if (cp[1] == '(')
*cp = '_';
} else if (strchr(forbid, *cp) != NULL)
*cp = '_';
}
utf8_stravis(&new_name, copy, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);