Ignore errors when getting screen size for zsh completion output serialization

This commit is contained in:
Kovid Goyal
2021-11-28 10:35:44 +05:30
parent cb09ae3e84
commit 0a5c73dee4

View File

@@ -227,8 +227,12 @@ def fish2_input_parser(data: str) -> ParseResult:
def zsh_output_serializer(ans: Completions) -> str:
lines = []
screen = screen_size_function(sys.stderr.fileno())()
width = screen.cols
try:
screen = screen_size_function(sys.stderr.fileno())()
except OSError:
width = 80
else:
width = screen.cols
def fmt_desc(word: str, desc: str, max_word_len: int) -> Iterator[str]:
if not desc: