Skip to content

Commit 04ace41

Browse files
authored
gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433)
1 parent 7a572d9 commit 04ace41

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,17 @@ def test_no_newline(self):
19911991
safe_patterns.append(r'\x1b\[\?25[hl]') # cursor visibility
19921992
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking
19931993

1994+
# rmam / smam - automatic margins
1995+
rmam = ti.get("rmam")
1996+
smam = ti.get("smam")
1997+
if rmam:
1998+
safe_patterns.append(re.escape(rmam.decode("ascii")))
1999+
if smam:
2000+
safe_patterns.append(re.escape(smam.decode("ascii")))
2001+
if not rmam and not smam:
2002+
safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins
2003+
safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins
2004+
19942005
# Modern extensions not in standard terminfo - always use patterns
19952006
safe_patterns.append(r'\x1b\[\?2004[hl]') # bracketed paste mode
19962007
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking (may be separate)

0 commit comments

Comments
 (0)