I like to use spacing here. There's a sweet spot between hug distance and handshake distance where you can often read which the other person wants to go for and likewise telegraph to them which one you have in mind. A barely perceptible move back and shake or a gentle move in and hug, or perhaps something else entirely. Body language is your friend.
This comment originally started as an analogy to striking distance and grappling distance in a fight, but I couldn't make it read unsatirically.