colors: Add error handling to reload
@@ -498,7 +498,10 @@ def read_file(input_file):
def reload_colors(vte):
"""Reload colors."""
- with open(CACHE_DIR / "sequences") as file:
+ sequence_file = pathlib.Path(CACHE_DIR / "sequences")
+
+ if sequence_file.is_file():
+ with open(sequence_file, "r") as file:
sequences = file.read()
# If vte mode was used, remove the problem sequence.
@@ -507,8 +510,8 @@ def reload_colors(vte):
# Decode the string.
sequences = bytes(sequences, "utf-8").decode("unicode_escape")
-
print(sequences, end="")
+
quit()
