We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4da968a commit 7321108Copy full SHA for 7321108
1 file changed
pre_commit/output.py
@@ -1,5 +1,6 @@
1
from __future__ import unicode_literals
2
3
+import os
4
import subprocess
5
import sys
6
@@ -9,9 +10,11 @@
9
10
11
# TODO: smell: import side-effects
12
try:
13
+ if not os.environ.get('TERM'):
14
+ raise OSError('Cannot determine width without TERM')
15
COLS = int(
16
subprocess.Popen(
- ['tput', 'cols'], stdout=subprocess.PIPE,
17
+ ('tput', 'cols'), stdout=subprocess.PIPE,
18
).communicate()[0] or
19
# Default in the case of no terminal
20
80
0 commit comments