telnet: support end and home keys
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>
Wed, 10 Mar 2021 23:36:17 +0000 (00:36 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 19 Mar 2021 21:58:59 +0000 (21:58 +0000)
this will help navigate to the line start and end easily

Change-Id: I3f42eb5267df64c59a85ece67de5fce39a8843ec
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/6094
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
src/server/telnet_server.c

index 407ab68aefcd74d41d31f205e6e16fb3828cbef2..e9de4f033b30d93354089d55a19d0d9bf58be40b 100644 (file)
@@ -596,6 +596,12 @@ static int telnet_input(struct connection *connection)
                                                telnet_history_up(connection);
                                        } else if (*buf_p == 'B') {     /* cursor down */
                                                telnet_history_down(connection);
+                                       } else if (*buf_p == 'F') { /* end key */
+                                               telnet_move_cursor(connection, t_con->line_size);
+                                               t_con->state = TELNET_STATE_DATA;
+                                       } else if (*buf_p == 'H') { /* home key */
+                                               telnet_move_cursor(connection, 0);
+                                               t_con->state = TELNET_STATE_DATA;
                                        } else if (*buf_p == '3')
                                                t_con->last_escape = *buf_p;
                                        else