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.
37 - left
38 - up
39 - right
40 - down
JSch jsch = new JSch();
Channel channel = session.openChannel("shell");
OutputStream out = channel.getOutputStream();
out.write(asciiDecimalCode); // send characters
The escape sequence for "Arrow up" is
\x1b is the code for ESC (Escape).
You can see it for yourself by typing Ctrl+VUp.
The Ctrl+V tells bash: "Don't try to interpret the next input; just insert it verbatim".