more changes to make tmux behave like screen
merge upstream changes