Tmux pane selection with mouse

charactersmodemousetmux

I have the following problem while using tmux under Ubuntu. I enabled mouse-mode to switch between panes by clicking the mouse, but the switching is not always successful, and random characters appear in my terminal.

screenshot:
screenshot

My tmux.conf file:

unbind %
bind | split-window -h
bind - split-window -v

# Mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set mouse-utf8 off

# Active pane border colour
set-option -g pane-active-border-fg yellow

# Load layout
bind q source-file ~/.tmux/dev_laptop
bind Q source-file ~/.tmux/dev_mon

# Show Pane Number
set-option -g status-left '#P'

I'm using the latest tmux (version 1.7), and the problem is terminal independent (tried it with xterm, gnome-terminal, guake).

Others experienced the same problem, but the solutions didn't work for me:
1) http://code.google.com/p/iterm2/issues/detail?id=855
2) Why are random characters inserted into my tmux session?

Best Answer

I think you need to remove the line

set mouse-utf8 off

My environment is similar to yours. I use Ubuntu 12.10, Tmux 1.7, Gnome-terminal and Konsole. I don't have this problem without this line. I have not found character setting in Gnome-terminal but in Konsole it's Utf-8.

Side note: Don't use mouse, keyboard is much much faster.

Related Question