I am writing a program that reads input from Javascript and send those readings to bash.
I can successfully run many actions, like "A-Z" letters, TAB, CTRL+C, etc. But I realize that I cannot send properly to bash the ARROW UP.
If I read the ascii code from Javascript, I get the following as explained Binding arrow keys in JS/jQuery
37 - left
38 - up
39 - right
40 - down
However, when I send arrow up to the terminal, decimal key code 38, I write an ampersand (as by following a ascii table http://www.asciitable.com/)
So, my question is: what code do I have to send from Java to bash to tell bash "arrow key up" ?
PD_ I realize that it might be different depending on the operating system and this code might not be considered an ascii code as this post suggest: enter link description here
Edit I write from Java to bash by using the following code:
JSch jsch = new JSch();
[...]
Channel channel = session.openChannel("shell");
OutputStream out = channel.getOutputStream();
out.write(asciiDecimalCode); // send characters
Thanks in advance.