Change terminal titles: support tmux, improve parsing