tools/mac-window-drag.md

Drag any window by holding a modifier key (macOS)

Goal: hold a modifier and click-drag anywhere inside a window to move it, without needing to grab the titlebar.

What doesn't work anymore

The old hidden AppKit default:

defaults write -g NSWindowShouldDragOnGesture -bool true

(then Ctrl+Cmd + drag anywhere). This used to work years ago but is unreliable on modern macOS — confirmed not working on macOS 26.6.2 even with the default correctly set (defaults read -g NSWindowShouldDragOnGesture → 1) and the app fully relaunched. Apple's window server just doesn't honor it for most apps anymore. Not worth chasing further.

What works: Swift Shift

brew install swift-shift
  • Free, open source. Grant it Accessibility permission when prompted (System Settings → Privacy & Security → Accessibility).
  • Works at the Accessibility/event-tap level instead of relying on the dead AppKit default, so it's reliable.
  • Pick your own modifier key (e.g. Option, or Ctrl+Cmd) and drag any window from anywhere — no need to hit the titlebar.
  • Confirmed working 2026-09-14.

Why I needed this

Set macos-window-buttons = hidden in Ghostty's config (~/.config/ghostty/config) for a cleaner look, which removes the traffic-light buttons. With macos-titlebar-style = tabs, the titlebar/tab strip is usually still draggable from empty space, but Swift Shift is the reliable fallback for any window (Ghostty or otherwise) when you don't want to hunt for a draggable titlebar area.