aristanetworks / bst

A one-stop shop for process isolation
MIT License
99 stars 9 forks source link

pty: fix opost handling & cleanup #48

Closed Snaipe closed 3 years ago

Snaipe commented 3 years ago

The original code was slightly broken, because the inner tty was -opost while the outer one has opost set. This meant that the inner tty was passing newlines through, while the outer turned them to CRLF.

The code also cleans up the idiosyncratic use of isatty -- we are already getting the termios, so ENOTTY is our isatty check, better ask for forgiveness than permission.