import struct
import termios
import time
+import platform
from fcntl import ioctl
from . import curses
raw.cc[termios.VTIME] = 0
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
+ # In macOS terminal we need to deactivate line wrap via ANSI escape code
+ if platform.system() == "Darwin" and os.getenv("TERM_PROGRAM") == "Apple_Terminal":
+ os.write(self.output_fd, b"\033[?7l")
+
self.screen = []
self.height, self.width = self.getheightwidth()
self.flushoutput()
tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
+ if platform.system() == "Darwin" and os.getenv("TERM_PROGRAM") == "Apple_Terminal":
+ os.write(self.output_fd, b"\033[?7h")
+
if hasattr(self, "old_sigwinch"):
signal.signal(signal.SIGWINCH, self.old_sigwinch)
del self.old_sigwinch