Use wait_for from rstuk, that is called through Shell.remote