prepare for push_image
always wait with a timeout, to not block signals
make wait_for_state public
add resize_tty to process