Skip to content

Commit

Permalink
console: force disable readline bracketed paste
Browse files Browse the repository at this point in the history
GNU Readline starting from version 8.1 has bracketed paste[0] enabled by
default which complicates handling pasted multiline text and is not
supported for now.

This patch disables the feature even if it is enabled in inputrc, by user
or by default.

[0] https://cirw.in/blog/bracketed-paste

Needed for tarantool#4317

NO_TEST=readline config
NO_DOC=readline config
NO_CHANGELOG=readline config
  • Loading branch information
Lord-KA committed Feb 28, 2023
1 parent 2ba2c63 commit caac47f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/box/lua/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,13 @@ tarantool_lua_console_init(struct lua_State *L)
history_comment_char = '#';
history_write_timestamps = 1;

/*
* Force disable readline bracketed paste in console, even if it's
* set in the inputrc, is enabled by default (eg GNU Readline 8.1),
* or by user.
*/
rl_variable_bind("enable-bracketed-paste", "off");

serializer_yaml = lua_yaml_new_serializer(L);
serializer_yaml->encode_invalid_numbers = 1;
serializer_yaml->encode_load_metatables = 1;
Expand Down

0 comments on commit caac47f

Please sign in to comment.