summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-05-11 21:48:24 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-05-11 21:48:24 -0400
commit3a2af4d81effe0c8701146c98d12b08dc0622214 (patch)
treefa9e6f0e7f4d107a5fab825e1bcc2d6b92456f1b /cmd2.py
parent2bd17dbc34ce88a4cd5375dadb0406b891a1fdb6 (diff)
downloadcmd2-git-3a2af4d81effe0c8701146c98d12b08dc0622214.tar.gz
Windows terminal doesn't use ANSI escape codes
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index b5dbcfbd..bd48c404 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1106,6 +1106,10 @@ class Cmd(cmd.Cmd):
:param end: str - end code to tell GNU Readline about end of invisible characters
:return: str - prompt safe to pass to GNU Readline
"""
+ # Windows terminals don't use ANSI escape codes and Windows readline isn't based on GNU Readline
+ if sys.platform == "win32":
+ return prompt
+
escaped = False
result = ""