Detect external computer connecting via Thunderbolt

Is there a way to detect an external computer connecting via Thunderbolt?

I connect my iMac to my Macbook Air via Thunderbolt and then use the iMac as an external display using ⌘-F2 on the iMac to enter Target Display mode. It’s annoying to have to hit the keyboard command (and even have a keyboard) each time. Is there a way to detect the connection on the iMac and trigger the command?

There is no Thunderbolt trigger, no.

You could perhaps have a periodic or sleep/wake trigger that detected the presence of the thunderbolt connection, and then performed the action.

Any plans to add one? i can think of a couple of my cases where this will be so useful

There are always plans to add things - my todo list has around 2000 items in it currently.

Currently I’m am (when not holidaying with my family in Kalbarri like last week) busily working on 7.0, which will not come out for a long time yet. It will have a variety of new features, but exactly which ones remains uncertain or unannounced, and generally I try not to discuss future features at all, and certainly not before I implement them, unless it is to say that a feature probably will not happen or will not happen in a specific release (which tends to offend people unfortunately).