summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@qlyoung.net>2021-02-08 02:15:24 +0100
committerQuentin Young <qlyoung@qlyoung.net>2021-02-08 04:51:07 +0100
commitdab6893f15cdb597d43ec86906657b88dbf8da16 (patch)
tree7f485b7b8ec261eec5c1a9f088539d2d1dbada72
parentMerge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise (diff)
downloadfrr-dab6893f15cdb597d43ec86906657b88dbf8da16.tar.xz
frr-dab6893f15cdb597d43ec86906657b88dbf8da16.zip
vtysh: disable bracketed paste in readline
GNU Readline 8.1 enables bracketed paste by default. This results in newlines not ending the readline() call, which breaks the ability of users to paste in configs to vtysh's interactive shell. Disable bracketed paste. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
-rw-r--r--vtysh/vtysh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index efb6b28ac..e026a2862 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -4001,10 +4001,16 @@ static char *vtysh_completion_entry_function(const char *ignore,
void vtysh_readline_init(void)
{
/* readline related settings. */
+ char *disable_bracketed_paste =
+ XSTRDUP(MTYPE_TMP, "set enable-bracketed-paste off");
+
rl_initialize();
+ rl_parse_and_bind(disable_bracketed_paste);
rl_bind_key('?', (rl_command_func_t *)vtysh_rl_describe);
rl_completion_entry_function = vtysh_completion_entry_function;
rl_attempted_completion_function = new_completion;
+
+ XFREE(MTYPE_TMP, disable_bracketed_paste);
}
char *vtysh_prompt(void)