Skip to content

Commit a84136d

Browse files
committed
Switch pty use to fix solaris
Use the child instead of parent fd when manipulating pty for color.
1 parent 3cdc6c9 commit a84136d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pre_commit/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ def __enter__(self) -> Pty:
168168
self.r, self.w = openpty()
169169

170170
# tty flags normally change \n to \r\n
171-
attrs = termios.tcgetattr(self.r)
171+
attrs = termios.tcgetattr(self.w)
172172
assert isinstance(attrs[1], int)
173173
attrs[1] &= ~(termios.ONLCR | termios.OPOST)
174-
termios.tcsetattr(self.r, termios.TCSANOW, attrs)
174+
termios.tcsetattr(self.w, termios.TCSANOW, attrs)
175175

176176
return self
177177

0 commit comments

Comments
 (0)