return 70
else:
def _tty_width():
+ forced = os.environ.get('BUP_TTY_WIDTH', None)
+ if forced:
+ return int(forced)
s = struct.pack("HHHH", 0, 0, 0, 0)
try:
s = fcntl.ioctl(sys.stderr.fileno(), termios.TIOCGWINSZ, s)
else:
buglvl = helpers.atoi(environ.get(b'BUP_DEBUG'))
force_tty = helpers.atoi(environ.get(b'BUP_FORCE_TTY'))
+ tty_width = helpers.atoi(environ.get(b'BUP_TTY_WIDTH'))
cmd = b"""
- sh -c 'BUP_DEBUG=%d BUP_FORCE_TTY=%d bup %s'
- """ % (buglvl, force_tty, subcmd)
+ sh -c 'BUP_DEBUG=%d BUP_FORCE_TTY=%d BUP_TTY_WIDTH=%d bup %s'
+ """ % (buglvl, force_tty, tty_width, subcmd)
argv = [b'ssh']
if port:
argv.extend((b'-p', port))
from bup.compat import add_ex_tb, add_ex_ctx, argv_bytes, wrap_main
from bup.helpers import atoi, columnate, debug1, log, merge_dict, tty_width
from bup.io import byte_stream, path_msg
+from bup.options import _tty_width
cmdpath = path.cmddir()
tty_env = merge_dict(environ,
{b'BUP_FORCE_TTY': (b'%d'
% ((fix_stdout and 1 or 0)
- + (fix_stderr and 2 or 0)))})
+ + (fix_stderr and 2 or 0))),
+ b'BUP_TTY_WIDTH': b'%d' % _tty_width(), })
else:
tty_env = environ