Show More
@@ -147,13 +147,13 b' class ProcessHandler(object):' | |||
|
147 | 147 | # can set pexpect's search window to be tiny and it won't matter. |
|
148 | 148 | # We only search for the 'patterns' timeout or EOF, which aren't in |
|
149 | 149 | # the text itself. |
|
150 | child = pexpect.spawn(self.sh, args=['-c', cmd]) | |
|
150 | child = pexpect.spawn(self.sh, args=['-c', cmd], encoding=enc) | |
|
151 | 151 | flush = sys.stdout.flush |
|
152 | 152 | while True: |
|
153 | 153 | # res is the index of the pattern that caused the match, so we |
|
154 | 154 | # know whether we've finished (if we matched EOF) or not |
|
155 | 155 | res_idx = child.expect_list(patterns, self.read_timeout) |
|
156 |
print(child.before[out_size:] |
|
|
156 | print(child.before[out_size:], end='') | |
|
157 | 157 | flush() |
|
158 | 158 | if res_idx==EOF_index: |
|
159 | 159 | break |
@@ -169,7 +169,7 b' class ProcessHandler(object):' | |||
|
169 | 169 | try: |
|
170 | 170 | out_size = len(child.before) |
|
171 | 171 | child.expect_list(patterns, self.terminate_timeout) |
|
172 |
print(child.before[out_size:] |
|
|
172 | print(child.before[out_size:], end='') | |
|
173 | 173 | sys.stdout.flush() |
|
174 | 174 | except KeyboardInterrupt: |
|
175 | 175 | # Impatient users tend to type it multiple times |
General Comments 0
You need to be logged in to leave comments.
Login now