Software⏱️ 3 min read📅 2026-06-04

How to Fix: How to copy and paste with a mouse with tmux

Use tmux's mouse mode to copy and paste with the mouse.

Quick Answer: Enable tmux's mouse mode by adding the following to your ~/.tmux.conf file: set-option 'mouse-mode', 'xterm-8bit'

When using tmux on OSX, copying and pasting with a mouse can be frustrating due to the inability to hold down Option and select text within a pane. This issue affects users who prefer a mouse-based interface for text selection.

The current workaround involves entering visual mode and using vim movements, which may not be ideal for all users.

🛑 Root Causes of the Error

  • The root cause of this issue lies in tmux's default behavior of selecting text outside the pane when holding down Option and clicking with the mouse. This is because tmux uses a different selection mechanism than traditional terminals.
  • Another possible cause could be conflicts between tmux and OSX's built-in clipboard management, which may interfere with the copy-paste functionality.

✅ Best Solutions to Fix It

Enabling Mouse Selection in tmux

  1. Step 1: Open your terminal and run the command `set-option 'mouse-sync' on` to enable mouse selection.
  2. Step 2: Alternatively, you can use the `bind-key 'm-s' send-keys -e` command to map the mouse middle button to the select text command.
  3. Step 3: To confirm that mouse selection is working correctly, try selecting some text with your mouse and pressing Enter. The selected text should be copied to the clipboard.

Configuring tmux's Selection Mechanism

  1. Step 1: Run the command `bind-key 'mouse-1' send-keys -e` to map the left mouse button to the select text command.
  2. Step 2: You can also use the `set-option 'mouse-mode' visual` command to enable visual mode for mouse selection. This will allow you to select text using your mouse without having to hold down Option.

🎯 Final Words

By following these steps, you should be able to copy and paste with a mouse within tmux on OSX, eliminating the need to cycle through panes or zoom in to access the selected text.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions