package/readline: disable bracketed paste by default
authorMarkus Mayer <mmayer@broadcom.com>
Fri, 26 Feb 2021 20:08:21 +0000 (12:08 -0800)
committerYann E. MORIN <yann.morin.1998@free.fr>
Fri, 26 Feb 2021 21:42:56 +0000 (22:42 +0100)
As of readline 8.1, "bracketed paste" is enabled by default. However,
the feature causes control characters to appear in captured (telnet)
session output. This can throw off pattern matching if the output is to
be processed by scripts.

Let's keep the previous default of leaving this feature disabled and
provide a configuration option for users to enable it.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
[yann.morin.1998@free.fr:
  - explicit enable/disable
  - no indentation in conditional block
  - rewrap help text
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/readline/Config.in
package/readline/readline.mk

index 7021472623c8a7f88a36cf2f2d32265e89edc0c2..fd21cfeaf8d926bddc055eba126fedfe800971c6 100644 (file)
@@ -7,3 +7,21 @@ config BR2_PACKAGE_READLINE
          as they are typed in.
 
          https://tiswww.case.edu/php/chet/readline/rltop.html
+
+config BR2_PACKAGE_READLINE_BRACKETED_PASTE
+       bool "Enable bracketed paste"
+       depends on BR2_PACKAGE_READLINE
+       help
+         Enable the "bracketed paste" feature in libreadline.
+
+         Bracketed paste is helpful for interactive sessions when
+         one wants to prevent pasted text from being interpreted
+         as typed-in commands. However, it also causes control
+         characters to show up in the raw output of a (telnet)
+         session. This can cause issues and throw off pattern
+         matching if the session output is being captured for
+         automated processing.
+
+         For further information on this feature and whether you
+         may want it, see:
+             https://cirw.in/blog/bracketed-paste
index 326cffab188028df85f77b333ec8f877bf758b52..06a96b67a8b385812c9e72e5983b344e2f5f231d 100644 (file)
@@ -16,6 +16,12 @@ READLINE_LICENSE = GPL-3.0+
 READLINE_LICENSE_FILES = COPYING
 READLINE_CPE_ID_VENDOR = gnu
 
+ifeq ($(BR2_PACKAGE_READLINE_BRACKETED_PASTE),y)
+READLINE_CONF_OPTS += --enable-bracketed-paste-default
+else
+READLINE_CONF_OPTS += --disable-bracketed-paste-default
+endif
+
 define READLINE_INSTALL_INPUTRC
        $(INSTALL) -D -m 644 package/readline/inputrc $(TARGET_DIR)/etc/inputrc
 endef