]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433)
authorChris Eibl <138194463+chris-eibl@users.noreply.github.com>
Mon, 5 Jan 2026 21:46:08 +0000 (22:46 +0100)
committerGitHub <noreply@github.com>
Mon, 5 Jan 2026 21:46:08 +0000 (22:46 +0100)
Lib/test/test_pyrepl/test_pyrepl.py

index baf03ef6cd95eebc872094f88ac068305b0e1633..00dcbdc562ae64852fe17db39ef8a61bbcc47647 100644 (file)
@@ -1991,6 +1991,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)