And part of detaching means that he says whatever the F he's going to say, or do whatever the F he's going to do, but YOU don't have to get all bent out of shape over it. (Personally, I say a little choice word or two under my breath if necessary, and then go on my merry way. Detached.)
Don't stew.
When you feel like venting about what a jerk he is, pause, take a deep breath, and thank your lucky stars that a)you are strong and capable and b) that your sons have at least one parent who is strong and capable.