Revert 5234ae1..ef986d0

This rolls back to commit 5234ae14f46b99adc6147f4e99937527c2f6c7a8.
Fix for detecting paste on Mac

I think this is finally right.