title: Unity: Can you read/write to standard in/output of a console application while still having it appear in the console?
body: <p>I have written two independant applications: A unity game that wants to interact with a console application, and a windows uwp console application that connects to a bluetooth device and pulls data from it for the unity application. I can start the console app using the Process class in a Unity script, but the problem is I can't just redirect standard input and output as it prevents it from displaying in or being read from the console app. The Unity code doesn't have the capacity to provide the console app with all the input it needs, and the output needs to be written to a file and read by users, but ideally the Unity game would be able to give certain commands to the console app to start/stop it etc.</p>
  
  <p>I had tried setting up a process in Unity: </p>
  
  <pre><code>        hrConsole.StartInfo.FileName = "HeartRateConsole";
          hrConsole.StartInfo.RedirectStandardInput = true;
          hrConsole.StartInfo.RedirectStandardOutput = true;
          hrConsole.StartInfo.UseShellExecute = false;
          hrConsole.Start();
          yield return new WaitForSeconds(3f);
          hrConsole.StandardInput.WriteLine(alphanum);
  </code></pre>
  
  <p>But that leaves the console app as an empty, unresponsive black box. I looked into redirecting the input of the console app after it has already started but that seemed to be a pretty inadvisable hack and not much of a real solution. I've looked into windows pipes a little bit, but I'm not sure that they're what I want here. Would they be able to provide an interface between the two apps, and can the console application read from and write to standard input/output and a pipe? </p>
  
  <p>The console app itself takes user input to parse through available devices, services, and characteristics to see what to subscribe to, however I can't entirely automate this input as the specific device we want to connect to changes and even if I could, the problem of the Unity application needing to read the output of the console still remains.</p>
  
  <p>I'm unsure of what code would need to be shown for this since it's more of a structural/design problem than a specific part of code but if there is anything else I should show let me know.</p>
  
  <p>EDIT: Something that occurs to me now, would it be possible to essentially re-create the window in Unity?</p>