Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 30327:365812902904
scmutil: extend termwidth() to return terminal height, renamed to termsize()
It appears crecord.py has its own termsize() function. I want to get rid of it.
The fallback height is chosen from the default of cmd.exe on Windows, and
VT100 on Unix.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 20 Oct 2016 23:09:05 +0900 |
parents | 5c379b1f56c7 |
children | 318a24b52eeb |
comparison
equal
deleted
inserted
replaced
30326:392633d7860e | 30327:365812902904 |
---|---|
820 if 'COLUMNS' in encoding.environ: | 820 if 'COLUMNS' in encoding.environ: |
821 try: | 821 try: |
822 return int(encoding.environ['COLUMNS']) | 822 return int(encoding.environ['COLUMNS']) |
823 except ValueError: | 823 except ValueError: |
824 pass | 824 pass |
825 return scmutil.termwidth(self) | 825 return scmutil.termsize(self)[0] |
826 | 826 |
827 def formatted(self): | 827 def formatted(self): |
828 '''should formatted output be used? | 828 '''should formatted output be used? |
829 | 829 |
830 It is often desirable to format the output to suite the output medium. | 830 It is often desirable to format the output to suite the output medium. |