Skip to content
Myr

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

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

get_winterm_size() will return (0, 0) when invoked inside a subprocess. This is not very useful, so instead provide a sensible default.

authored by stxlvt · committed by Atausch · parent b1b4449 · Browse files · 1 file+5 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+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:click/termui.py+5 added-1 removed
175 unmodified lines
176 sz = shutil_get_terminal_size()177 return sz.columns, sz.lines178179 if get_winterm_size is not None:180 return get_winterm_size()180 size = get_winterm_size()181 if size == (0, 0):182 return (79, 24)183 else:184 return size185186 def ioctl_gwinsz(fd):187 try:188 import fcntl
378 unmodified lines