Hey there, tech enthusiasts! If you’ve been dabbling with Tmux, you’ve likely run into the situation where you need to copy and paste content within your Tmux sessions. The ability to enable or disable clipboard functionality can be a game-changer in your workflow. That’s why today, I’ll guide you through how you can do just that. So, sit tight and let’s dive deep into the world of Tmux!
Newcomers, gear up with the basic knowledge of Tmux. Seasoned users, let’s not wait anymore and jump right in!
If Tmux is new territory for you, the basics of Tmux is your roadmap. For the Tmux experts, let’s hit the fast-forward button!
To enable clipboard copy-paste on Tmux
Enabling mouse gives you options to clipboard and copy-paste from tmux window and Windows or Linux or MAC Clipboard. Let’s look at how to enable copy-paste and mouse behaviour on tmux.
You can either run a command to activate it temporarily for that session by running
Prefix
:set -g mouse on
By default the prefix is Ctrl-B
Ctrl-B
:set -g mouse on
You can also make this a default behaviour of tmux, by adding the setting in ~/.tmux.conf
–
set -g mouse on
After adding the above line to the configuration file, you can reload tmux conf–
tmux source-file ~/.tmux.conf
To disable clipboard copy-paste on Tmux
Disabling mouse gives you options to prevent the clipboard and copy-paste option inside the tmux window or pane.
You can either run a command to activate it temporarily for that session by running
Prefix
:set -g mouse off
By default the prefix is Ctrl-B
Ctrl-B
:set -g mouse off
You can also make this a default behaviour of tmux, by adding the setting in ~/.tmux.conf
–
set -g mouse off
After adding the above line to the configuration file, you can reload tmux conf–
tmux source-file ~/.tmux.conf
If you are a vi
or vim
enthusiast, then you can enable vi-like copy paste behaviour on tmux as well.
So there you have it, folks! We’ve walked through how to enable or disable clipboard copy and paste in Tmux. It’s quite a handy trick, isn’t it? Remember, mastering tools like Tmux is all about understanding these little nuances that can massively boost your productivity. Don’t forget to practice these skills to make your Tmux journey smoother. Stay tuned for more such insightful tips and tricks!
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.