From a7c36d8552cc71538bc42087531866cc16851a39 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sat, 19 Nov 2016 10:42:52 +0100 Subject: [PATCH] vtysh: initialise readline before binding key when libreadline initialises itself, it also reads .inputrc, which may result in keybindings being set up. This means the builtin help on the '?' key can be overridden by that. Consistent availability of '?' behaviour trumps .inputrc setup here, so let's initialise readline first before binding that key (which means our keybinding wins). Signed-off-by: David Lamparter --- vtysh/vtysh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 177f2a5b20..6a14aab639 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2994,6 +2994,7 @@ void vtysh_readline_init (void) { /* readline related settings. */ + rl_initialize (); rl_bind_key ('?', (rl_command_func_t *) vtysh_rl_describe); rl_completion_entry_function = vtysh_completion_entry_function; rl_attempted_completion_function = (rl_completion_func_t *)new_completion; -- 2.39.5