wesm/pandas — pull request #625 by gwtaylor (2012-01-13 21:32:16+00:00)
Title: Make _get_terminal_size_linux() work inside Emacs

I'm using ipython inside Emacs. Detection of the console width and height is not working with the current implementation. ioctl seems to return (0,0). Therefore, performing an explicit check for cr == (0,0) (in addition to the check for not cr) before falling back to environment variables is a quick fix that I think shouldn't make any negative impact on non-emacs users.
I've also added the import of os.environ line since env previously wasn't defined.