[FROG] readline 8.1 and bracketed pasting in vtysh

mike tancsa mike at sentex.net
Tue Feb 2 12:17:43 UTC 2021


Thank you for posting this!   I thought I was going bonkers with this
issue as the route-maps I was entering kept not being able to be found
?!?!? Sure enough, if I start up the telnet interface, I am able to copy
and paste my old configs from a 3.x box I want to upgrade. This is on a
RELENG_12 FreeBSD box, frr7 from the ports.

    ---Mike

On 2/1/2021 10:27 PM, Mark Kamichoff wrote:
> tl;dr readline 8.1 turns on bracketed paste and appears to break
> multi-line pasting in vtysh
>
> Hi - 
>
> I noticed that on a few of my boxes I can no longer paste a set of
> commands into vtysh using either FRR 6.x or 7.x.  The result was that
> the lines were treated as a single line and therefore rejected.  For
> example, if I want to create a simple route-map like so:
>
> route-map foo permit 5
> set as-path prepend 1 2 3 4
> end
>
> Here's what happened when I first pasted the 3x lines:
>
> ====snip====
> excalibur(config)# route-map foo permit 5
> set as-path prepend 1 2 3 4
> end
>
> ====snip====
>
> (the pasted text is highlighted in the terminal)
>
> After hitting enter vtysh rejects the command because it sees it as a
> single line (I think):
>
> ====snip====
> % Unknown command: route-map foo permit 5
> set as-path prepend 1 2 3 4
> end
>
> excalibur(config)# 
> ====snip====
>
> The expected result should look something like this (I manually typed it
> in):
>
> ====snip====
> excalibur(config)# route-map foo permit 5
> excalibur(config-route-map)# set as-path prepend 1 2 3 4
> excalibur(config-route-map)# end
> excalibur#
> ====snip====
>
> I dug a little deeper and it looks like this is a result of bracketed
> paste[0] that has been enabled in the 8.1 release of GNU readline
> released in Dec of 2020[1].  I confirmed that an older system I have
> still running readline 8.0 does not have this issue.  I think vtysh
> rejects the command because of the escape characters that are used with
> bracketed paste.
>
> I couldn't find any option to disable bracketed paste in readline itself
> or vtysh.  Shells like Zsh and Bash have options for it in their config
> files.
>
> Does anyone know how to disable bracketed paste in vtysh?  Or, is there
> something else funky going on here?
>
> I'm using rxvt-unicode on Linux/X11.  I tested this with Terminal.app on
> Big Sur as well and got the same result.
>
> Thanks!
>
> - Mark
>
> [0] https://cirw.in/blog/bracketed-paste
> [1] https://lwn.net/Articles/839213/ (see h. in the CHANGES list)
>
>
> _______________________________________________
> frog mailing list
> frog at lists.frrouting.org
> https://lists.frrouting.org/listinfo/frog



More information about the frog mailing list