command_line: fix new line issue when using editor

This commit is contained in:
dece 2021-04-18 02:27:40 +02:00
parent 3a818812a9
commit 6574048763

View file

@ -174,12 +174,12 @@ class CommandLine:
except OSError: except OSError:
return return
command = ["vi", temp_filepath] command = self.editor_command + [temp_filepath]
open_external_program(command) open_external_program(command)
try: try:
with open(temp_filepath, "rt") as temp_file: with open(temp_filepath, "rt") as temp_file:
content = temp_file.read() content = temp_file.read().rstrip("\r\n")
os.unlink(temp_filepath) os.unlink(temp_filepath)
except OSError: except OSError:
return return