Command to Detect Connected Displays That Are Not Being Detected

New Contributor III

We have docks that when a Macbook is restarted the external device is not displayed until you reseat the USB-C cable.  I was wondering is there a way to send a command to the device to just check if displays are connected and connect them?

I know this sounds like an odd question, but some command must be being sent to the machine when you plug in a device that tells it to look for it, or is this just an electrical signal?

Does anyone have any experience with this?



New Contributor II

Hey, I think the closest you can get is listing the devices connected to the ports. If the display is not recognized, I can't think of any method that will report it. 

On intel devices issues like this get fixed by doing an NVRAM reset. But for Apple silicons, the NVRAM is reset every time the computer reboots. Does this happen with more than one mac? What cable are you using? It could be that the monitor has some sleep behaviour that is affecting the connection. Did you try with another cord?

There is a binary that tells you what's connected to the USB-C ports, but not sure if that helps with this specific case scenario. With ioreg and some clean up, this will display all active connections:

ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'