title: Combining interactive shell and recv_exit_status method using Paramiko
body: <p>I am using paramiko for SSH with my remote devices.<br>
  and I am make communication with them using paramiko shell (<code>invoke_shell()</code> method) for interactivity.<br>
  The main problem with paramiko shell (as I've read in many answers here) is that there is no guarantee that paramiko SSHClient methods which indicates that the server finished writing such as <code>recv_exit_status()</code> and <code>exit_status_ready()</code> will behave as expected.   </p>
  
  <p>So I created mechanism that will read the last line of the output from the shell and determine if this line contains only shell's prompt in such case the command execution was finished.<br>
  This is works in case there is <strong>no changes in prompt</strong>.</p>
  
  <p>Now I've read here <a href="https://stackoverflow.com/questions/28485647/wait-until-task-is-completed-on-remote-machine-through-python">Wait until task is completed on Remote Machine through Python</a> that 'exec_command()' method return tuple 'stdin, stdout, stderr' and preforming <code>stdout.channel.recv_exit_status()</code> will block channel until it is done.   </p>
  
  <p>My question is if I will create such a tuple and will preform <code>stdout.channel.recv_exit_status()</code> with <code>stdout</code> that I will get when I am open on each interactive command (meaning I will do 'shell_chan.send('something')' and then will do <code>stdout.channel.recv_exit_status()</code>) will it do the job? will it return only when interactive command has finished?</p>