Skip to content

Commit

Permalink
Fixes #338
Browse files Browse the repository at this point in the history
  • Loading branch information
stasinopoulos committed Jul 24, 2018
1 parent 9460328 commit ab976fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/thirdparty/colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class AnsiToWin32(object):
sequences from the text, and if outputting to a tty, will convert them into
win32 function calls.
'''
ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?') # Operating System Command
ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command

def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
# The wrapped stream (normally sys.stdout or sys.stderr)
Expand Down Expand Up @@ -171,9 +171,19 @@ def write_and_convert(self, text):

def write_plain_text(self, text, start, end):
if start < end:
self.wrapped.write(text[start:end])
self._write(text[start:end])
self.wrapped.flush()

# Reference: https://github.com/robotframework/robotframework/commit/828c67695d85519e4435c556c43ed1b00985df05
# Workaround for Windows 10 console bug:
# https://github.com/robotframework/robotframework/issues/2709
def _write(self, text, retry=5):
try:
self.wrapped.write(text)
except IOError, err:
if not (err.errno == 0 and retry > 0):
raise
self._write(text, retry-1)

def convert_ansi(self, paramstring, command):
if self.convert:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def print_question_msg(question_msg):
DESCRIPTION_FULL = "Automated All-in-One OS Command Injection and Exploitation Tool"
DESCRIPTION = "The command injection exploiter"
AUTHOR = "Anastasios Stasinopoulos"
VERSION_NUM = "2.6.5"
VERSION_NUM = "2.6.6"
STABLE_VERSION = False
if STABLE_VERSION:
VERSION = "v" + VERSION_NUM[:3] + "-stable"
Expand Down

0 comments on commit ab976fc

Please sign in to comment.