This is what I used to do in tmux to copy-paste (using the mouse, the keyboard works differently and it is not what I am interested about):
I have upgraded my OS, and this has gotten a new tmux version. I have not changed my .tmux.conf
config file.
This is what I have to do with the current version of tmux
, 1.6
(which comes pre-packaged in the latest crunchbang linux):
[0/24]
, probably something related to how many characters have been pasted), which mean little to me and I do not need / want (edit: it seems copy-mode
is entered automatically here)This is too much hassle for something I do dozens of times a day. How to get the old mechanism working again?
Triple-click the Left Mouse Button on a line to select the whole line and copy it into the primary selection. Click the Middle Mouse Button to paste from the primary selection. Ctrl + Shift + c to copy the selection into the clipboard. Ctrl + Shift + v to paste from the clipboard.
Using the command mode: To send the commands directly to the Tmux terminal, we need to enter the command mode by pressing the prefix keys followed by a colon (:). A command prompt will open up at the bottom of the terminal, where we can enter the Tmux commands.
The solution is to use tmux specific controls to access its own scrollback buffer: Ctrl-b then [ to enter copy mode, use Down/Up arrows or PageDown and PageUp keys, q or Enter to exit copy mode.
left-button
with shift
key press too.shift
key + middle-button
To restore the default copy/paste configuration you need to (at least temporarily) turn off mouse support within tmux:
prefix : set -g mouse off
Where prefix
is the tmux access key (Ctrl+B by default unless you re-map it). : starts command mode and set -g
sets the parameter globally.
When mouse mode is turned off, the standard copy/paste functions provided by your operating system work as expected.
Something else you might want to do is 'maximise' the current pane, so you can copy multiple lines easily.
If you’re working with an old (pre-2.1) version of tmux, you instead need to use the following:
prefix : set -g mode-mouse off
There are more details and some handy key bindings to automate all this here:
http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/
The main thrust of the article linked to above is this excerpt from .tmux.conf:
# disable mouse control by default - change 'off' to 'on' to enable by default. setw -g mode-mouse off set-option -g mouse-resize-pane off set-option -g mouse-select-pane off set-option -g mouse-select-window off # toggle mouse mode to allow mouse copy/paste # set mouse on with prefix m bind m \ set -g mode-mouse on \;\ set -g mouse-resize-pane on \;\ set -g mouse-select-pane on \;\ set -g mouse-select-window on \;\ display 'Mouse: ON' # set mouse off with prefix M bind M \ set -g mode-mouse off \;\ set -g mouse-resize-pane off \;\ set -g mouse-select-pane off \;\ set -g mouse-select-window off \;\ display 'Mouse: OFF' # zoom this pane to full screen bind + \ new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\ swap-pane -s tmux-zoom.0 \;\ select-window -t tmux-zoom # restore this pane bind - \ last-window \;\ swap-pane -s tmux-zoom.0 \;\ kill-window -t tmux-zoom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With