java - Do arrow keys don't work in terminal emulation vai ssh -
While ssh'ing in my machine, I am able to use Ctrl + P for command history in terminal emulator . I wanted to know that it is possible to increase the arrow keys too. I am ssh'ing through a program, via the command ssh user @ host Why am I asking this because, separately from the byte array, Before removing the individual characters, I am printing it when a character is pressed, so many numbers are visible in the byte array, but when I press the arrow keys, it does not print anything I do Ctrl + P works To act as the arrow keys will have to be. Please note that the shell value is / bin / bash In addition to this, I have used these words for TERM variable: dumb, vt100, xterm, linux. For secure login, I am using the GNID SSH library I am using. Update: (with tips as trifle) A small snippet of keyboard processing logic is as follows: the input comes in this way: The main listener code is: Thanks. Try logging in using key, eg from the man page: Four pseudo-TTI allocation to use it to execute arbitrary screen-based programs on a remote machine Can be useful, which can be very useful, e.g. When the menu service is implemented. < Code> (int i = 0; i & lt; len; i ++) {char c = (four) (data [i] & amp; 0xff); System.out.print (c + ","); If (C == 8) {If (Pausx & lt; 0) will continue; Posx--; to continue; } If (C == '\ r') {posx = 0; to continue; } If (c == '\ n') {posy ++; If (Pausi> = y) {for (int k = 1; k & lt; y; k ++) line [k - 1] = line [k]; Posy--; Line [y - 1] = new four [x]; For (int k = 0; k & lt; x; k ++) line [y - 1] [k] = ''; } to continue; }} // something else, and then adding letters to those
byte [buff = new byte [8, 1 9 2]; Try {while (true) {int len = in.read (buff); Return (lane == -1); AddText (buff, lane); }} {{Code} (exception E) {}
KeyAdapter kl = New KeyAdapter () {Public Zero Key Type (KeyEvent e) {System.out.println ("EVENT:" + e.getKeyCode ()); Int c = e.getKeyChar (); Try {out.write (c); } Hold (IOException e1) {} e.consume (); }};
ssh -t user @ host
Comments
Post a Comment