2015-09-03 7 views
7

Ich verwende tmux in einer SSH-Sitzung. Ich verwende mehrere Fenster und Fenster.tmux maus copy-mode springt nach unten

Ich habe den Maus-Modus aktiviert, der bisher sehr gut funktioniert.

Wenn ich Text auswähle, wird es automatisch in den tmux-Puffer kopiert und das Fenster springt zum Ende. Also, wenn ich nach oben scrolle und auf etw klicke, springt es zum Ende ... Wenn ich zwischen den Fenstern umschalte, wird ein Kopierbefehl ausgelöst und die Ausgabe geht an das Ende. Ich mag dieses Verhalten wirklich nicht und ich würde lieber eine Taste drücken, um zu kopieren oder auf q klicken, um den Kopiermodus oder etw zu beenden.

Ist es möglich, die automatische Kopie zu deaktivieren // automatisches Springen zum Ende der Maustaste loslassen?

Ich tmux 2.0 auf dem Server über ssh laufen. In Terminator auf dem Client.

# config                   
#{{{                    

# 0 is too far from ` ;)               
set -g base-index 1                

# Automatically set window title             
# set-window-option -g automatic-rename on          
# set-option -g set-titles on             

set -g default-terminal screen-256color           
set -g history-limit 10000              

set -g status-keys vi               
setw -g mode-keys vi                
setw -g mode-mouse on               
set -g mouse-select-window on             
set -g mouse-select-pane on              
set -g mouse-resize-pane on              

# No delay for escape key press             
set -sg escape-time 0               

#}}}                    

# bind keys                  
#{{{                    
# Reload tmux config                
bind r source-file ~/.tmux.conf             

# remap prefix to Control + a              
set -g prefix C-a                 
# bind 'C-a C-a' to type 'C-a'              
bind C-a send-prefix                
unbind C-b                   

# switch tabs with <b n>               
bind b previous-window                

# vi like paste                  
bind-key p paste-buffer                

# quick pane cycling                
unbind a                   
bind a select-pane -t :.+               

bind-key v split-window -h               
bind-key s split-window -v               

bind-key J resize-pane -D 10              
bind-key K resize-pane -U 10              
bind-key H resize-pane -L 10              
bind-key L resize-pane -R 10              

bind-key M-j resize-pane -D 2              
bind-key M-k resize-pane -U 2              
bind-key M-h resize-pane -L 2              
bind-key M-l resize-pane -R 2              

# Vim style pane selection               
bind h select-pane -L                
bind j select-pane -D                
bind k select-pane -U   
bind -n M-Down select-pane -D             

# find asci keycodes with "sudo showkey -a" - works only tmux >1.7    
# us-keyboard like [ ]               
bind-key -r 0xc3 display 'c3 prefix binding hack'        
bind-key -r 0xb6 copy-mode # ö             
bind-key -r 0xa3 paste-buffer # ä            
# us { }                   
bind-key -r 0x96 swap-pane -U # Ö - swap pane to prev position     
bind-key -r 0x84 swap-pane -D # Ä - to next pos 

#}}}       

Antwort

2

Ab Version 2.2 ist die Kopierauswahl -x verfügbar. Mit folgenden Optionen bleibt tmux nach dem Auswählen im Kopiermodus. Wählen Sie diejenige aus, die zu Ihrer Moduseinstellung passt.

bind-key -t vi-copy MouseDragEnd1Pane copy-selection -x 
bind-key -t emacs-copy MouseDragEnd1Pane copy-selection -x 
1

Sieht aus wie ein Upgrade auf tmux 2.1 Ihr Problem lösen könnte.

In Version 2.1 sie geändert Maus-Modus, Maus-select-Fenster/Fensterbereich usw. mit Einzel Maus-Schalter. Mausaktionen generieren jetzt Schlüsselereignisse, die als normale Schlüssel zugeordnet werden können.

4

ich in der Lage war Maus Auswahl auf den Grund gehen, indem folgend meinen ~/.tmux.conf in tmux (Version 2.2) zu stoppen Springen:

setw -g mouse on 
setw -g mode-keys vi 
unbind -t vi-copy MouseDragEnd1Pane 

Nachteil: Das hat den Nebeneffekt des Einschaltens vi Modus.

Ich fand this issue als relevant, und fand die obige Konfiguration in these dotfiles.

2

Ab tmux 2.5 sollten Sie

unbind -T copy-mode-vi MouseDragEnd1Pane