title: How to combine node-pty and xterm
body: <p>I added a terminal to my web application using node-pty on the server, ng-termianl (xterm.js) on the client and socket.io for the communication.  I have it basically working but I have some issues and maybe I'm making things to complicated so here are some questions:</p>
  <ol>
  <li>What tasks do I need to implement in the xterm and what should I expect node-pty to handle.</li>
  </ol>
  <ul>
  <li>create a history buffer to handle up/down arrows.</li>
  <li>create the terminal prompt</li>
  <li>hand left and right arrow</li>
  </ul>
  <ol start="2">
  <li><p>When listinging to the data event in node-pty I get both the echoed command,the response, and the new terminal line.  What is the the best way to filter out any data event that is not the respose to an issued command?  Sometimes the echoed command is</p>
  </li>
  <li><p>How do I choose a value for the node-pty column count?  Do the number of pty columns need to match up with the number of columns in the xterm?  If the command the user types in the xterm is long then the echoed command in jumbled in the pty echo of the issued command.</p>
  </li>
  </ol>