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:
- What tasks do I need to implement in the xterm and what should I expect node-pty to handle.
- create a history buffer to handle up/down arrows.
- create the terminal prompt
- hand left and right arrow
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
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.