Fix bug where pty_size() returns unreasonable rows/cols in Emacs