title: JSch Esc commands and encoding
body: <p>I'm writing an application to connect to a server over SSH, open an application (it runs on shell) and use it. I'm using  JSch and I've managed to connect, open the app and send commands to it. Now I'm facing 2 problems: </p>
  
  <ol>
  <li>On Windows I'm having encoding problems with the app (on Linux if I use the IDE console output to run it I have the same problem, it only shows right on bash). Here's a screehshot:<img src="https://i.stack.imgur.com/UBnCj.jpg" alt="with wrong encoding"> here's the screenshot of what it should show: <img src="https://i.stack.imgur.com/1nWd8.png" alt="with right encoding"></li>
  <li><p>The app I'm running, makes use of the ESC key and I cannot use it in the app I've write. It just writes <code>^[</code> on the output
  And here are the code I've used to do this application:</p>
  
  <pre><code>JSch shell = new JSch();
  Session session = shell.getSession("myUser", "myHost");
  session.setPassword("myPassword");
  session.setConfig("StrictHostKeyChecking", "no");
  session.connect();
  Channel channel = session.openChannel("shell");
  channel.setOutputStream(System.out);
  PipedInputStream in = new PipedInputStream();
  PipedOutputStream out = new PipedOutputStream(in);
  channel.setInputStream(in);
  channel.connect();
  out.write("my_application\n".getBytes());
  Thread.sleep(1000); //waiting for the app to load
  out.write("\n".getBytes());
  out.write("appUser\n".getBytes());
  out.write("appPassword\n".getBytes());
  channel.setInputStream(System.in);
  </code></pre></li>
  </ol>
  
  <p>PS: the server uses sh and not bash.</p>