From c29b1a98d9ef94a13befffd75d3b9963796dfa7b Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Thu, 6 Feb 2025 21:45:27 -0800 Subject: [PATCH] use os.linesep --- interactive_process/interactive_process.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interactive_process/interactive_process.py b/interactive_process/interactive_process.py index ccc877a..dd1206b 100644 --- a/interactive_process/interactive_process.py +++ b/interactive_process/interactive_process.py @@ -1,3 +1,5 @@ +import os + from ptyprocess import PtyProcessUnicode import platform from select import select @@ -19,7 +21,7 @@ def __init__(self, env={"PS1": "", "TERM": "dumb"}, echo=False): def send_command(self, command): try: - self.process.write(f"{command}\n") + self.process.write(f"{command}" + os.linesep) except OSError as e: raise ReadWriteError(f"Failed to write to stdin due to OSError") from e