From 1f1b7da6f42e083148565da7112770b403197e04 Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Wed, 30 Aug 2017 07:44:58 +0200 Subject: [PATCH] #682: Warn if PS1 changed after thefuck initialization --- thefuck/output_readers/read_log.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thefuck/output_readers/read_log.py b/thefuck/output_readers/read_log.py index 23d80cbc..82a3d2d0 100644 --- a/thefuck/output_readers/read_log.py +++ b/thefuck/output_readers/read_log.py @@ -69,6 +69,11 @@ def get_output(script): warn("Output log isn't specified") return None, None + if const.USER_COMMAND_MARK not in os.environ.get('PS1', ''): + warn("PS1 doesn't contain user command mark, please ensure " + "that PS1 is not changed after The Fuck alias initialization") + return None, None + try: with open(os.environ['THEFUCK_OUTPUT_LOG'], 'rb') as log_file: lines = _get_output_lines(script, log_file)