Implement xterm mouse mode