This implementation should be less prone to stutters/stalls than my earlier hacky implementation in pty/src/ssh.rs