File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,15 @@ namespace tui {
182182 // tell the terminal to check where the cursor is
183183 csi_fn (query_position, " 6n" );
184184
185+ #ifdef _WIN32
186+ // returns: (rows;cols)
187+ inline std::pair<unsigned , unsigned > get_position () {
188+ auto info = get_console_buf_info ();
189+ auto rows = info.dwCursorPosition .X + 1 ;
190+ auto cols = info.dwCursorPosition .Y + 1 ;
191+ return {rows, cols};
192+ }
193+ #else
185194 // returns: (rows;cols)
186195 // NOTE: can take a while (eg 16ms) on (relatively) slow terminals
187196 inline std::pair<unsigned , unsigned > get_position () {
@@ -200,6 +209,8 @@ namespace tui {
200209
201210 return {rows, cols};
202211 }
212+ #endif
213+
203214 } // namespace cursor
204215
205216 namespace screen {
You can’t perform that action at this time.
0 commit comments