summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index e77f4557..0bb21d4a 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1913,6 +1913,13 @@ a..b, a:b, a:, ..b items by indices (inclusive)
# Set echo back to its original state
self.echo = saved_echo
+ # Post-process the file to escape un-escaped "/" regex escapes
+ with open(args.transcript, 'r') as fin:
+ data = fin.read()
+ post_processed_data = data.replace('/', '\/')
+ with open(args.transcript, 'w') as fout:
+ fout.write(post_processed_data)
+
plural = 's' if len(history) > 1 else ''
self.pfeedback('{} command{} and outputs saved to transcript file {!r}'.format(len(history), plural,
args.transcript))