File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 77#
88# Copyright © 2014-2020 Dominic Davis-Foster <dominic@davis-foster.co.uk>
99#
10- # get_terminal_size, _get_terminal_size_windows, _get_terminal_size_tput and _get_terminal_size_linux
10+ # get_terminal_size, _get_terminal_size_windows, _get_terminal_size_tput and _get_terminal_size_posix
1111# from https://gist.github.com/jtriley/1108174
1212# Copyright © 2011 jtriley
1313#
6060#
6161
6262# stdlib
63- import fcntl
6463import inspect
6564import os
6665import platform
@@ -157,7 +156,7 @@ def get_terminal_size() -> Tuple[int, int]:
157156 # needed for window's python in cygwin's xterm!
158157
159158 if current_os in {"Linux" , "Darwin" } or current_os .startswith ("CYGWIN" ):
160- tuple_xy = _get_terminal_size_linux ()
159+ tuple_xy = _get_terminal_size_posix ()
161160
162161 if tuple_xy is None :
163162 print ("default" )
@@ -203,7 +202,8 @@ def _get_terminal_size_tput() -> Optional[Tuple[int, int]]:
203202 return None
204203
205204
206- def _get_terminal_size_linux () -> Optional [Tuple [int , int ]]:
205+ def _get_terminal_size_posix () -> Optional [Tuple [int , int ]]:
206+ import fcntl
207207
208208 def ioctl_GWINSZ (fd ):
209209 try :
You can’t perform that action at this time.
0 commit comments