From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 5 Jan 2026 22:20:51 +0000 (+0100) Subject: [3.14] gh-143394: filter for turning off automatic margins in test_no_newline (GH... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c889ff6ba5ddd4c42ba0dc56a2944c4c109654ae;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) (GH-143459) (cherry picked from commit 04ace41fe2cf648be433503d0c336b154ad63a3b) Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> --- diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index b1c6e5c99696..9c365007bebc 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1981,6 +1981,17 @@ class TestMain(ReplTestCase): safe_patterns.append(r'\x1b\[\?25[hl]') # cursor visibility safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking + # rmam / smam - automatic margins + rmam = ti.get("rmam") + smam = ti.get("smam") + if rmam: + safe_patterns.append(re.escape(rmam.decode("ascii"))) + if smam: + safe_patterns.append(re.escape(smam.decode("ascii"))) + if not rmam and not smam: + safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins + safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins + # Modern extensions not in standard terminfo - always use patterns safe_patterns.append(r'\x1b\[\?2004[hl]') # bracketed paste mode safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking (may be separate)