title: JSCH Channel Shell, Input / Output
body: <p>I am having some issues using JSCH and sending commands to shell.</p>
  
  <p>I have a console GUI Window setup and system.out has been redirected to the TextArea and this works fine, however i am unable to input any commands</p>
  
  <p>Here is the connect code for the session</p>
  
  <pre><code>    this.channel=session.openChannel("shell");
  
      PipedInputStream pip = new PipedInputStream(40);
      this.channel.setInputStream(pip);
  
      PipedOutputStream pop = new PipedOutputStream(pip);
      PrintStream print = new PrintStream(pop);
  
      this.channel.setOutputStream(System.out);
  
      print.println("ls"); 
  
      this.channel.connect(3*1000);
  </code></pre>
  
  <p>This works fine, and runs the ls command and displays the output, however if i now want to run more commands these dont work.</p>
  
  <p>i have a TextBox setup and a "Send" button to send these commands to the server coded below.</p>
  
  <pre><code>    String send = jServerInput.getText();
  
      try {
          PipedInputStream pip = new PipedInputStream(40);
          //this.channel.setInputStream(pip);
  
          PipedOutputStream pop = new PipedOutputStream(pip);
          PrintStream print = new PrintStream(pop);
          //this.channel.setOutputStream(System.out);
          //System.out.println(send);
          print.println(send);
      } catch (IOException iOException) {
      }
  </code></pre>
  
  <p>However hitting the "Send" Button does nothing. I am clearly missing something simple</p>