sh: reset sh bindings on bind -e, bind -v

Until this change, any bindings set in histedit() were lost on calls to
bindcmd().

Only bind -e and bind -v call libedit's keymacro_reset(). Currently you
cannot fool libedit/map.c:map_bind() by trying something like bind -le
as when p[0] == '-', it does a switch statement on p[1].
This commit is contained in:
Piotr Pawel Stefaniak 2021-09-19 22:17:01 +02:00
parent 908b8e32f9
commit 9413dfd331

View file

@ -559,6 +559,13 @@ bindcmd(int argc, char **argv)
fclose(out);
if (argc > 1 && argv[1][0] == '-' &&
memchr("ve", argv[1][1], 2) != NULL) {
Vflag = argv[1][1] == 'v';
Eflag = !Vflag;
histedit();
}
INTON;
return ret;