mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-27 02:09:06 +00:00
Use subprocess to call stty size when COLUMNS is not set
This commit is contained in:
parent
2c8d32de33
commit
4f2a5e06da
1 changed files with 6 additions and 5 deletions
11
youtube-dl
11
youtube-dl
|
@ -2996,11 +2996,12 @@ def parseOpts():
|
||||||
if columns:
|
if columns:
|
||||||
return int(columns)
|
return int(columns)
|
||||||
|
|
||||||
# TODO: Breaks on phihag's system
|
try:
|
||||||
#if sys.platform.startswith('linux'):
|
sp = subprocess.Popen(['stty', 'size'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
# try:
|
out,err = sp.communicate()
|
||||||
# return os.popen('stty size', 'r').read().split()[1]
|
return out.split()[1]
|
||||||
# except: pass
|
except:
|
||||||
|
pass
|
||||||
return None
|
return None
|
||||||
|
|
||||||
max_width = 80
|
max_width = 80
|
||||||
|
|
Loading…
Reference in a new issue