Browse Source

rline: fix backspace in legacy line editor

K. Lange 2 years ago
parent
commit
e3a966232d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/rline.c

+ 2 - 0
lib/rline.c

@@ -149,6 +149,7 @@ try_rev_search_again:
 			case KEY_NONE:
 				break;
 			case KEY_BACKSPACE:
+			case 0x7F: /* delete */
 				if (collected > 0) {
 					collected--;
 					input[collected] = '\0';
@@ -417,6 +418,7 @@ int rline(char * buffer, int buf_size, rline_callbacks_t * callbacks) {
 				}
 				continue;
 			case KEY_BACKSPACE:
+			case 0x7F: /* delete */
 				if (context.collected) {
 					int should_redraw = 0;
 					if (!context.offset) {