Terminal Activity - connectivity issues

Been searching but I couldn’t find an answer

I am using terminal activities.
sometimes it works, sometimes it don’t.
it would work for hours, then once it stops it will not connect for hours. then suddenly connects after a few hours.
even if I do nothing.

what could be wrong?

terminal activity

terminal activity 2