aristanetworks / bst

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

tty: stop spamming VEOF on raw terminals, and cleanly handle EOF #97

Closed Snaipe closed 3 months ago

Snaipe commented 3 months ago

This PR contains two changes:

The first one is a change in how we handle hangups from stdin; if the child pty is not in raw mode (or rather, is in non-canonical mode), and therefore isn't interpreting VEOF, then we won't send any. Instead, we now just hang up the terminal, which causes the session to die with a SIGHUP.

The second fixes a weirdity I noticed where we would not handle EOF properly, and commands like bst --tty cat </dev/null would not terminate.