That’s a very tough situation, you are physically nearby, the only way you can escape at this time is through your mind. Keeping your focus on things other than him. At least until you can move away.
Is there any sort of project you can apply yourself to? Maybe something you always wanted to do but always put off? I find if I’m physically occupied and my mind is in practical mode I do better.