]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: initialise readline before binding key
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 19 Nov 2016 09:42:52 +0000 (10:42 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 23 Nov 2016 07:32:30 +0000 (08:32 +0100)
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 <equinox@opensourcerouting.org>
vtysh/vtysh.c

index 177f2a5b2062b8e8c608ff929f630398b427974f..6a14aab639afd752b0834824681108e35378061c 100644 (file)
@@ -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;