diff -r 4b1af1c867fa -r 5c379b1f56c7 mercurial/scmposix.py --- a/mercurial/scmposix.py Thu Oct 20 21:38:44 2016 +0900 +++ b/mercurial/scmposix.py Thu Oct 20 21:42:11 2016 +0900 @@ -41,11 +41,11 @@ else: return [os.path.expanduser('~/.hgrc')] -def termwidth(): +def termwidth(ui): try: import array import termios - for dev in (sys.stderr, sys.stdout, sys.stdin): + for dev in (ui.ferr, ui.fout, ui.fin): try: try: fd = dev.fileno()