mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 00:24:47 +04:00
Fix terminal width detection.
This commit is contained in:
parent
06830ab590
commit
fa9db4ec23
3 changed files with 6 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
|
@ -11,7 +10,7 @@ from pre_commit import five
|
|||
# TODO: smell: import side-effects
|
||||
COLS = int(
|
||||
subprocess.Popen(
|
||||
['tput', 'cols'], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w'),
|
||||
['tput', 'cols'], stdout=subprocess.PIPE,
|
||||
).communicate()[0] or
|
||||
# Default in the case of no terminal
|
||||
80
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue