MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / _tty_width

Function _tty_width

options.py:55–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54
55def _tty_width():
56 s = struct.pack("HHHH", 0, 0, 0, 0)
57 try:
58 import fcntl, termios
59 s = fcntl.ioctl(sys.stderr.fileno(), termios.TIOCGWINSZ, s)
60 except (IOError, ImportError):
61 return _atoi(os.environ.get('WIDTH')) or 70
62 (ysize,xsize,ypix,xpix) = struct.unpack('HHHH', s)
63 return xsize or 70
64
65
66class Options:

Callers 1

_gen_usageMethod · 0.85

Calls 1

_atoiFunction · 0.85

Tested by

no test coverage detected