Skip to content

Instantly share code, notes, and snippets.

@metakirby5
Last active July 2, 2016 08:46
Show Gist options
  • Save metakirby5/8bc2b054a8519cc8ce00051fe9b8be08 to your computer and use it in GitHub Desktop.
Save metakirby5/8bc2b054a8519cc8ce00051fe9b8be08 to your computer and use it in GitHub Desktop.
Stop Safari hanging when selecting the address bar or opening a new tab

This shit has been bugging me for too long, so I went on a hunt and found a workaround.

The Symptoms are as follows:

  • Clicking the address bar results in a 1-4 second delay
  • Opening links in new tabs results in a 1-4 second delay
  • +T results in a 1-4 second delay
  • PressAndHold[<pid>]: IMKServer Stall detected is present in /var/log/system.log at the time of the hang.

It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down. The fix may have some unwanted effects (disabling the PressAndHold helper), I haven't really noticed any.

  1. Reboot into system restore mode (+R immediately after boot)
  2. Navigate to Utilities > Terminal
  3. csrutil disable
  4. defaults write -g ApplePressAndHoldEnabled -bool false
  5. launchctl remove $(launchctl list | grep -oE 'com.apple.PressAndHold.+$')
  6. sudo chmod -x /System/Library/Input\ Methods/PressAndHold.app/Contents/MacOS/PressAndHold
  7. (optional) csrutil enable
  8. Reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment