Updates:

Before you the method in this post, try XG’s suggestion to restart in safe mode.

This method in this post requires trial and error if you have lot of displays. Konstantin Gredeskoul has created an automated bash script and shared it on GitHub. Check his comment.

Or directly go to GitHub for instructions: Changing OSX Underscan

I recently purchased an Asus external monitor. The first thing I noticed on plugging it to my MacBook was that there was a blank space at each of the edges. This wasted quite a bit of screen estate and also made everything blurry. This can generally happen due to wrong underscan/overscan settings.

On testing monitor with other laptops, I found that it was working fine. So it was something with my Mac. macOS has a slider to adjust overscan in system preferences. However, it only appears for TVs. So it was not appearing for me.

It took me two hours but I finally fixed it with help of command line and Stack Overflow.

The Stack Overflow question: “How to reload .com.apple.iokit.graphics underscan without restarting?”. This was unrelated to my problem but helped me to find the file where configuration is stored.

In case you encounter same issue, here’s a step by step guide to save you a couple of hours:

Disclaimer: You may damage your system with a wrong command, so proceed with caution. I am just sharing what worked for me and am not responsible for any loss or harm caused by anything in this post. It worked for me on a MacBook Pro (Retina, 13-inch, Early 2015) running macOS High Sierra (10.13.2), it may or may not work for you.

Fixing Overscan/Underscan

  1. Open terminal.
  2. You want to open /var/db/.com.apple.iokit.graphics file. To do that, enter following command in terminal: sudo open -a TextEdit /var/db/.com.apple.iokit.graphics
  3. TextEdit will open with the file. You’ll notice that the file has following structure:
  4. Starting with line 5, every key tag is a separate display and following dict is list of preferences for it.
  5. Note: You may need to do a bit of trial and error to find the correct display. In my case, I only use a limited number of displays, so I reset the settings for every display, restarted and it was fixed.
  6. Find the lines that say <key>pscn</key>. This is the preference that controls underscan/overscan.
  7. Next line after every pscn key will look like this: <integer>10000</integer> (line 34 above).
  8. 10000 means that there is no underscan. Value less than 10000 means that display will be underscanned, larger value means it is overscanned.
  9. For values less than 10000, change them back to 10000.
  10. Save the file, you may need to enter your admin password.
  11. Restart.

The issue should be fixed. I hope it will save some time for you. In meantime, if you find any shortcuts, do let me know via comments.