Allow setting TERM_WIDTH via env var
This commit is contained in:
parent
b7dab5926e
commit
968864ae1f
1 changed files with 6 additions and 2 deletions
|
@ -35,8 +35,12 @@ STYLE_TAG_PATTERN = re.compile(r"""
|
|||
> # literal
|
||||
""", re.X)
|
||||
|
||||
terminal_size = shutil.get_terminal_size()
|
||||
TERM_WIDTH = terminal_size.columns
|
||||
TERM_WIDTH = os.getenv('TERM_WIDTH')
|
||||
try:
|
||||
TERM_WIDTH = int(TERM_WIDTH)
|
||||
except:
|
||||
terminal_size = shutil.get_terminal_size()
|
||||
TERM_WIDTH = terminal_size.columns
|
||||
|
||||
|
||||
def colorize(message):
|
||||
|
|
Loading…
Reference in a new issue