21.04 中 Gnome 终端中粘贴的文本始终突出显示

PJ *_*ngh 8 gnome-terminal 21.04

在 Ubuntu 21.04 中,当文本粘贴到 Gnome 终端时,文本总是高亮显示。

  • 看起来好像文本被选中,但它只是突出显示
  • 如果您右键单击此突出显示的文本,实际上会禁用“复制”选项。
  • 单击终端或单击突出显示的文本不会取消突出显示文本。
  • 取消突出显示粘贴文本的唯一方法是键入一个键。
  • 如果您尝试通过单击并拖动鼠标指针来选择突出显示的文本,文本颜色实际上会反转,并且文本看起来好像没有被选中,而实际上它是被选中的。 在此处输入图片说明

这种令人困惑的行为在 Ubuntu 20.04 中不存在。

  • 在 Ubuntu 20.04 中,将文本粘贴到 Gnome 终端时,文本不会突出显示。
  • 然后,按预期选择文本将其突出显示。 在此处输入图片说明

如何在 Ubuntu 21.04 中恢复 Gnome 终端的这种令人困惑的行为,使其行为类似于 Ubuntu 20.04 中的 Gnome 终端?

Fed*_*eli 14

I also noticed this behavior after upgrade to 21.04. Don't think this as a bug: It is a new "default setting" in Bash 5.1.

First check:

$ bind -v | grep bracketed
set enable-bracketed-paste on
Run Code Online (Sandbox Code Playgroud)

Then, try to disable (for the current session):

$ bind 'set enable-bracketed-paste off'
$ bind -v | grep bracketed
set enable-bracketed-paste off

Run Code Online (Sandbox Code Playgroud)

And retry your findings in that terminal session. This is also explained in: /sf/ask/2492779411/

I would suggest living with this new default setting of Bash, since it prevents the accidental middle-clicking or copy/pasting of multiple lines (consisting of possibly malicious commands) from the clipboard.