From: OpenOCD-Gerrit <ope...@us...> - 2021-08-30 13:54:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 70cd395f3f0b7f7974125ce6e728980e855626ea (commit) from efe944dfc9fa9041ec2e006b702e9830f60f04bc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 70cd395f3f0b7f7974125ce6e728980e855626ea Author: Tarek BOCHKATI <tar...@gm...> Date: Tue Aug 17 13:29:56 2021 +0100 server/telnet: support 'CTRL+C' like in terminal 'CTRL+C': - keeps the line content so the user can refer to it (like copy/paste) - marks the line with '^C', as hint that the command was not executed - permit the user to write a new command Change-Id: Ib784c827d64fdc439a35db461d8387a62d3bfbbf Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6439 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 253591ec9..f7b3f6449 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -718,6 +718,13 @@ static int telnet_input(struct connection *connection) t_con->line_cursor--; } t_con->state = TELNET_STATE_DATA; + } else if (*buf_p == CTRL('C')) { /* interrupt */ + /* print '^C' at line end, and display a new command prompt */ + telnet_move_cursor(connection, t_con->line_size); + telnet_write(connection, "^C\n\r", 4); + t_con->line_cursor = 0; + t_con->line_size = 0; + telnet_prompt(connection); } else if (*buf_p == CTRL('F')) { /* cursor right */ if (t_con->line_cursor < t_con->line_size) telnet_write(connection, t_con->line + t_con->line_cursor++, 1); ----------------------------------------------------------------------- Summary of changes: src/server/telnet_server.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- Main OpenOCD repository |