From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:46:08 +0000 (+0100) Subject: gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04ace41fe2cf648be433503d0c336b154ad63a3b;p=thirdparty%2FPython%2Fcpython.git gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) --- diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index baf03ef6cd95..00dcbdc562ae 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -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)