From: David Lamparter Date: Sat, 19 Nov 2016 09:42:52 +0000 (+0100) Subject: vtysh: initialise readline before binding key X-Git-Tag: frr-3.0-branchpoint~147^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a7c36d8552cc71538bc42087531866cc16851a39;p=matthieu%2Ffrr.git 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 --- 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;