Skip to content

Instantly share code, notes, and snippets.

@justicefreed
justicefreed / better_tmux_mouse_select_copy.md
Created June 8, 2026 17:36
Better tmux mouse select and copy config

I've fought with tmux a long time with it's mouse selection and copy behavior. I like using mouse mode for the scrolling functionality but I've been plauged by issues where I want to paste something in, but when I click into the terminal window, it registers a "drag" event isntead of a click, causing a silent copy to occur, wiping my clipboard.

While the yank plugin fixes this, it also forces you to enter copy mode first, and I wanted to be able to select text from stdout or prior command without always entering copy mode. To use my config, you should NOT use yank.

This configuration (goes in tmux.conf.local, usually) does the following:

  • Adds a conditional check to the mouse drag event (when in the default / root mode). It checks the mouse's position vs the "cursor" postition (the active prompt line in this scenario), and only enters copy-mode and starts the tmux selection if the mouse is ABOVE the prompt line. If the mouse is on or below the prompt line, it does nothing. Since you normally click on t
@justicefreed
justicefreed / README.md
Created May 13, 2025 17:21
Fix VLAN MTU Bug on OSX (eg HTTPS pages won't load)

Bug / Issue Description

OSX does not correctly fragment packets on VLAN virtual interfaces for default MTU settings. Additionally, manually setting interface MTU settings do not always persist across interface disconnection, sleep, and reboot in some OSX versions.

What is supposed to happen

  1. A virtual interface of type "VLAN" has been created and attached to a parent interface
  2. You try and make a network request of any kind using that VLAN / virtual interface that expects a response larger than 1472 Bytes, like an HTTPS web page (HTTP may not exceed this).
  3. Because the request is larger than the interface MTU, it is split into fragments. Each fragment should be at most the size of the parent MTU MINUS the 4 bytes for the VLAN header(s)