I am writing a program that reads input from Javascript and sends these readings to bash.
I can successfully launch many actions, such as the letters "AZ", TAB, CTRL + C, etc. But I understand that I can not send bash to the ARROW correctly.
If I read ascii code from Javascript, I get the following as described Arrow keys in JS / jQuery
37 - left
38 - up
39 - right
40 - down
However, when I send the arrow to the terminal, decimal key code 38, I write ampersand (as, following the ascii table http://www.asciitable.com/ )
So my question is: what code do I need to send from Java to bash in order to tell bash the up arrow?
PD_ I understand that it may differ depending on the operating system, and this code cannot be considered the ascii code, as this message suggests: enter a description of the link here
Edit
I am writing from Java to bash with the following code:
JSch jsch = new JSch();
[...]
Channel channel = session.openChannel("shell");
OutputStream out = channel.getOutputStream();
out.write(asciiDecimalCode);
Thanks in advance.
source
share