add mouse support for tmux and some minor changes