Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))


Expand Down