tmux’s parser has no clever trick in it. It’s a state machine with a transition cache, a bsearch(), a trie, and a width cache — four small optimisations, each of which swaps an…
clean_name() is tmux’s one defence against name-based injection, and it works by encoding rather than filtering: it stores names in a form where the dangerous characters…