I'm designing a web which include a terminal using Xterm.js and would like transfer the string to the server. I can type some string on it but can't use 'backspace', 'delete', 'home' functions.
I tried to do that functions by myself, but there are a lot function need to do.
e.g. Backspace
term.on('key', (key, ev) => {
const code = key.charCodeAt(0);
if(code == 127){ //Backspace
term.write("\b \b");
}
});
I could delete the last character, but can't delete inside the string... Are these functions to be done by myself? Is there a more convenient module?
Thanks!