when doing a history search (^R), restore old input line on

abortion (^G – ^C is SIGINT and doesn’t work like this, but
that’s actually good IMO)

prompted by enquiry about the Emacs editing mode by <smultron:#MidnightBSD>
This commit is contained in:
tg
2008-10-19 20:15:45 +00:00
parent 9be489ea90
commit 2fc9fb99d7
4 changed files with 14 additions and 7 deletions

6
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.138 2008/10/13 23:06:02 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.139 2008/10/19 20:15:43 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -2202,6 +2202,10 @@ x_search_hist(int c)
}
}
offset = x_search(pat, 0, offset);
} else if (f == XFUNC_abort) {
if (offset >= 0)
x_load_hist(histptr + 1);
break;
} else { /* other command */
x_e_ungetc(c);
break;