Skip to content

Commit 3a2af4d

Browse files
committed
Windows terminal doesn't use ANSI escape codes
1 parent 2bd17db commit 3a2af4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,10 @@ def _surround_ansi_escapes(prompt, start="\x01", end="\x02"):
11061106
:param end: str - end code to tell GNU Readline about end of invisible characters
11071107
:return: str - prompt safe to pass to GNU Readline
11081108
"""
1109+
# Windows terminals don't use ANSI escape codes and Windows readline isn't based on GNU Readline
1110+
if sys.platform == "win32":
1111+
return prompt
1112+
11091113
escaped = False
11101114
result = ""
11111115

0 commit comments

Comments
 (0)