diff --git a/changelogs/fragments/1839-disable-bracketed-paste.yml b/changelogs/fragments/1839-disable-bracketed-paste.yml new file mode 100644 index 00000000000..1398fc3ec1d --- /dev/null +++ b/changelogs/fragments/1839-disable-bracketed-paste.yml @@ -0,0 +1,2 @@ +bugfixes: + - aws_ssm - disable `enable-bracketed-paste` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) diff --git a/plugins/connection/aws_ssm.py b/plugins/connection/aws_ssm.py index 173dd6a084c..263305ab41e 100644 --- a/plugins/connection/aws_ssm.py +++ b/plugins/connection/aws_ssm.py @@ -627,7 +627,7 @@ def _prepare_terminal(self): disable_prompt_complete = None end_mark = "".join([random.choice(string.ascii_letters) for i in xrange(self.MARK_LENGTH)]) disable_prompt_cmd = to_bytes( - "PS1='' ; printf '\\n%s\\n' '" + end_mark + "'\n", + "PS1='' ; bind 'set enable-bracketed-paste off'; printf '\\n%s\\n' '" + end_mark + "'\n", errors="surrogate_or_strict", ) disable_prompt_reply = re.compile(r"\r\r\n" + re.escape(end_mark) + r"\r\r\n", re.MULTILINE)