Focus terminal when window state change.