@@ -63,6 +63,7 @@ def read_escape_sequence(escape_code, sep=";"):
6363
6464 return out
6565
66+
6667def get_device_attributes ():
6768 """
6869 A function that returns an array containing the current
@@ -77,48 +78,4 @@ def get_device_attributes():
7778 :rtype: Tuple[int]
7879 """
7980
80- return _read_escape_sequence ("\033 [c" , "c" )
81-
82-
83- def get_terminal_geometry ():
84- """
85- A function that returns the size of the terminal text area in character cells.
86- Format: ``(height, width)``.
87-
88- .. note::
89- Returns an empty tuple on Windows
90-
91- :rtype: Tuple[int]
92- """
93- return _read_escape_sequence ("\033 [18t" , "t" )
94-
95-
96- def get_terminal_pixel_geometry ():
97- """
98- A function that returns the size of the terminal text area in pixels.
99- Foramt: ``(height, width)``
100-
101- .. note::
102- Returns an empty tuple on Windows
103-
104- :rtype: Tuple[int]
105- """
106-
107- return _read_escape_sequence ("\033 [14t" , "t" )
108-
109-
110- def get_cell_geometry ():
111- """
112- A function that returns the cell geometry of the terminal in pixels. This is achieved by simply
113- dividing the terminal's reported pixel size by its reported size in characters.
114- Format: ``(height, width)``.
115-
116- .. note::
117- Returns an empty tuple on Windows
118-
119- :rtype: Tuple[int]
120- """
121- pixel_height , pixel_width = get_terminal_pixel_geometry ()
122- character_height , character_width = get_terminal_geometry ()
123-
124- return (pixel_height // character_height , pixel_width // character_width )
81+ return read_escape_sequence ("\033 [c" , "c" )
0 commit comments