1

I've been using CentOS versions 6, 7 and 8 for a long time. Finally, I started using CentOS 9 Stream version. It doesn't matter whether GNOME desktop version or server version (black screen), I noticed a change when I connect to these devices with putty from windows environment.

In order to send a command to the server via SSH, instead of typing manually, I saved the previously ready configuration commands in a text file and sometimes in an excel cell. When I'm going to paste a command from a text file, I'm copying multiple lines for "enter" processing. In the same way, when you copy and paste the excel cell, it detects one more line at the end and "enter" is passed. This is exactly the method I want.

But I can't do this in CentOS 9 Stream. Whether it is a single line or multiple lines from the text file, or copying and pasting a command from excel, "enter" never goes through automatically, I have to press it from the keyboard.

Is this update in CentOS 9 a shell update? How do I change this state in CentOS 9 like the app in old CentOS 6-7-8 versions?

1
  • 1
    Create script with these command on the server and sun it instead of paste list of commands. Commented Sep 9, 2023 at 12:21

1 Answer 1

1

It's an update to the bash shell, yes. Instead of always processing input line by line, it now requests the terminal (PuTTY in this case) to use "bracketed paste" mode and indicate when text is being pasted rather than typed.

(It also affects other programs using bash's "readline" text input library, such as the interactive Python.)

The solution I would recommend is to...not paste blobs of commands anymore, but to script everything – instead of having a huge Excel table, have a collection of .sh scripts (or Ansible playbooks, or...), and instead of pasting stuff individually to each server, have a Bash or PowerShell script to loop over them all with for x in $hosts.

Disabling bracketed paste in your shell is possible through ~/.inputrc:

$include /etc/inputrc
set enable-bracketed-paste off

or through ~/.bashrc:

bind 'set enable-bracketed-paste off'

The terminal settings in PuTTY might also have an option to disable this on the sending side (though it can be useful in text editors even if you don't want it in shells).

1
  • This explanation was very apt. I found the solution in the same way on another platform, I did not have the opportunity to write it here. I left a 'userful' vote, but it couldn't be processed because I didn't have 15 interactions yet. Thanks a lot. Commented Sep 10, 2023 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .