reset_prompt();
break;
- case KEY_DELETE:
- case KEY_DEL:
- /* No need to delete when input is empty */
- if (strlen(hdt_cli.input)==0) break;
- /* Don't delete when cursor is at the end of the line */
- if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break;
+ case KEY_CTRL('d'):
+ case KEY_DELETE:
+ /* No need to delete when input is empty */
+ if (strlen(hdt_cli.input)==0) break;
+ /* Don't delete when cursor is at the end of the line */
+ if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break;
for (int c = hdt_cli.cursor_pos;
c < (int)strlen(hdt_cli.input) - 1; c++)
move_cursor_left(strlen(hdt_cli.input + hdt_cli.cursor_pos));
break;
+ case KEY_DEL:
case KEY_BACKSPACE:
/* Don't delete prompt */
if (hdt_cli.cursor_pos == 0)