Commit bea67d8f authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Suppress /bin/stty error message thrown by an ssh session.

parent bff4324d
......@@ -67,7 +67,7 @@ def termsize():
# Alternatives at http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
import shlex, subprocess, re
try:
output = subprocess.check_output(shlex.split('/bin/stty -a'), universal_newlines=True)
output = subprocess.check_output(shlex.split('/bin/stty -a 2>/dev/null'), universal_newlines=True)
except (OSError, subprocess.CalledProcessError, AttributeError):
return (24, 80)
for pattern in ('rows\D+(\d+); columns\D+(\d+);', '\s+(\d+)\D+rows;\s+(\d+)\D+columns;'):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment