Browse Source

rline_exp: ^K, ^U, visual indicator for ^V

K. Lange 5 years ago
parent
commit
1870bdbdc2
1 changed files with 12 additions and 0 deletions
  1. 12 0
      lib/rline_exp.c

+ 12 - 0
lib/rline_exp.c

@@ -1490,6 +1490,8 @@ static int read_line(void) {
 						return 1;
 					case 22: /* ^V */
 						/* Don't bother with unicode, just take the next byte */
+						place_cursor_actual();
+						printf("^\b");
 						insert_char(getc(stdin));
 						immediate = 0;
 						break;
@@ -1502,6 +1504,16 @@ static int read_line(void) {
 						render_line();
 						place_cursor_actual();
 						break;
+					case 11: /* ^K - Clear to end */
+						the_line->actual = column;
+						immediate = 0;
+						break;
+					case 21: /* ^U - Kill to beginning */
+						while (column) {
+							delete_at_cursor();
+						}
+						immediate = 0;
+						break;
 					case '\t':
 						if (tab_complete_func) {
 							/* Tab complete */