Fixes some regressions from 35ca42413 ("Simplify some parse_util functions"). The tmux tests are not beautiful but I find them easy to write. Probably a pexpect test would also be enough here?
35ca42413