Skip to content
Myr

Merge pull request #997 from H1SWarrior/get_winterm_size

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Rebased fix to get_winterm_size() returning (0, 0)

authored by Dan Sully · committed by GitHub · parents 21d5125, f816faf · Browse files · 1 file+7 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:click/termui.py+7 added-1 removed
191 unmodified lines
192 if shutil_get_terminal_size:193 sz = shutil_get_terminal_size()194 return sz.columns, sz.lines195196 # We provide a sensible default for get_winterm_size() when being invoked197 # inside a subprocess. Without this, it would not provide a useful input.198 if get_winterm_size is not None:197 return get_winterm_size()199 size = get_winterm_size()200 if size == (0, 0):201 return (79, 24)202 else:203 return size204205 def ioctl_gwinsz(fd):206 try:207 import fcntl
389 unmodified lines