Search code examples
amazon-web-servicesshellaws-ssmamazon-linux

Pasting multi line text in AWS SSM connection


I have used both AWS SSM on the web UI and also installing the SSM plugin on my terminal (Using MacOS Monterrey Terminal) and on both I have the same odd behaviour when pasting multi-line text:

My source text:

"Lorem ipsum dolor sit amet, 
consectetur adipiscing elit, 

sed do eiusmod tempor incididunt 

ut labore et dolore magna aliqua. 
Ut enim ad minim veniam" 

When pasting it in a file inside my Amazon Linux 2 instance connected through SSM (both Web and CLI plugin)

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam"

I expect it to paste the source text exactly including all the line break characters, like it does when one connects using plain SSH.

It def seems to be omitting the line break characters \n or carry return character. Not sure how to proceed.


Solution

  • Which editor are you using? I noticed the same weird behavior with nano but fortunately, if you use vi, your formatting is respected in both the AWS SSM web UI and via the SSM plugin.

    enter image description here