macOS 10.13 Screen Sharing: Command key glitches

Standard

I recently was provided a new MacBook for work (previously I’d been using my personal Mac, and we’re tightening data security). I purged the personal laptop of all corporate data, but I still prefer my personal machine and setup when working from home. So I started using Mac’s built-in Screen Sharing.app, connecting to the work laptop on home wifi and just doing all my work stuff that way. I have my personal apps open (Twitter, AirMail, iMessage, etc) alongside the work laptop screen (where I tend to have Sublime Text, Slack and Outlook running all day).

For the most part “It Just Works”™️, but occasionally after switching back and forth between desktops, command-key combos stop working on the remote machine. Things like copy/paste work, but command-Tab and command-space are caught by the host.

After some Googling, I found most people link this behavior to over-eager listening by Dock.app. So I wrote an Alfred workflow to quickly fix the issue.

https://angrychimp.net.s3.amazonaws.com/alfred.app/Reset%20Screen%20Share%20Keyboard.alfredworkflow

Here’s what it does.

  1. Closes Screen Sharing.app
  2. Kills running Dock.app processes
  3. Restarts Screen Sharing.app
  4. Opens the most recent connection (from the Open Recent menu)

So far, it’s worked beautifully.