class Net::SSH::Connection::Channel

def wait

channel.wait
channel.exec("grep ...") { ... }

handy for blocking while you wait for some channel to finish.
Runs the SSH event loop until the channel is no longer active. This is
def wait
  connection.loop { active? }
end