title: stdout hangs on blinking cursor
body: <p>I have a process struct, which holds a process handle:</p>
  <pre><code>pub struct Process {
      process: Child,
      init: bool
  }
  </code></pre>
  <p>I have a seperate function where I can 'talk' to the engine.</p>
  <pre><code>    fn talk_to_engine(&amp;mut self, input: &amp;String) -&gt; String {
          let stdin = &amp;mut self.process.stdin.as_mut().unwrap();
          stdin.write_all(input.as_bytes()).expect(&quot;Failed to write to process.&quot;);
  
          let mut s = String::new();
          return match self.process.stdout.as_mut().unwrap().read_to_string(&amp;mut s) {
              Err(why) =&gt; panic!(&quot;stdout error: {}&quot;, why),
              Ok(_) =&gt; s
          }
      }
  </code></pre>
  <p>Yet when I run the function, I get a blinking cursor in the terminal and it does nothing.</p>
  <p>EDIT: I call the init_engine function which in turn calls the above mentioned function:</p>
  <pre><code>    /// Initialize the engine.
      pub fn init_engine(&amp;mut self, _protocol: String, depth: String) {
         //Stockfish::talk_to_engine(self, &amp;protocol);
         let output = Stockfish::talk_to_engine(self, &amp;format!(&quot;go depth {}&quot;, &amp;depth));
  
          print!(&quot;{:?}&quot;, output);
         self.init = true;
      }
  </code></pre>
  <p>if you call init_engine, let's say, like this: <code>struct.init_engine(&quot;uci&quot;.to_string(), &quot;1&quot;.to_string());</code></p>