diff --git a/tools/vsh.c b/tools/vsh.c index 05de54b5b0..f954f7af77 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2908,6 +2908,10 @@ vshReadlineInit(vshControl *ctl) const char *break_characters = " \t\n`@$><=;|&{("; const char *quote_characters = "\"'"; + /* initialize readline stuff only once */ + if (ctl->historydir) + return 0; + /* Opaque data for autocomplete callbacks. */ autoCompleteOpaque = ctl;