diff --git a/colorama/ansitowin32.py b/colorama/ansitowin32.py index 8177d5b..275d441 100644 --- a/colorama/ansitowin32.py +++ b/colorama/ansitowin32.py @@ -8,6 +8,7 @@ from .win32 import windll, winapi_test +INSIDE_PYDEV = 'sitecustomize' in sys.modules #for avoid ansi-escape replacing when runngin inside eclipse-pydev winterm = None if windll is not None: winterm = WinTerm() @@ -164,11 +165,12 @@ def write_and_convert(self, text): ''' cursor = 0 text = self.convert_osc(text) - for match in self.ANSI_CSI_RE.finditer(text): - start, end = match.span() - self.write_plain_text(text, cursor, start) - self.convert_ansi(*match.groups()) - cursor = end + if not INSIDE_PYDEV: #avoid ansi-escape replacing when inside eclipse-pydev + for match in self.ANSI_CSI_RE.finditer(text): + start, end = match.span() + self.write_plain_text(text, cursor, start) + self.convert_ansi(*match.groups()) + cursor = end self.write_plain_text(text, cursor, len(text))