How to Restart the Dock

The Dock in Mac OS X is a quick-launcher for your favorite applications, but it seems to encompass more than that; it also provides the ability to minimize and maximize windows as well as to quickly swap between running apps with a keystroke (apple-tab), which may well be my most frequently executed keystroke, second only to ctrl-K in emacs. But sometimes, the Dock hangs. Suddenly, you’re paralyzed, only able to work within the current app (and possibly only its currently window). Ugh. Rebooting does solve this, but that seems like a big hammer. I’ve looked for a “restart the Dock” option under the Apple menu (nope) or for Dock entry on the list of apps you can “Force Quit” (and hopefully Force Restart).. nope.

The most recent time this happened, I was left with only Firefox working, so I was able to google while in a Dockless state. I came across this tip, which gives the so-obvious-in-retrospect Unix-flavor solution:

  1. Find “Dock” in your current list of processes (ps -auxww | grep Dock).
  2. Get its process id.
  3. Send it a hangup signal to force a restart (kill -HUP <pid>).

Done! (A single-line AppleScript solution is also mentioned. Someday I may venture into the world of AppleScripting. As of now, it is a complete unknown to me.)

Post a Comment

I knew this already. I learned something new!