Skip to content

Commit 6e43802

Browse files
committed
ScreenCommandsBasic.h: Added function get_gotorc_str().
1 parent 943d79b commit 6e43802

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/Termin8or/screen/ScreenCommandsBasic.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ namespace t8
105105
#endif
106106
}
107107

108+
std::string get_gotorc_str(int r, int c)
109+
{
110+
#ifdef _WIN32
111+
// Windows doesn't use ANSI escape codes for cursor movement.
112+
return "";
113+
#else
114+
// ANSI escape code for cursor positioning (1-indexed)
115+
return "\033[" + std::to_string(r + 1) + ";" + std::to_string(c + 1) + "H";
116+
#endif
117+
}
118+
108119
std::pair<int, int> get_terminal_window_size()
109120
{
110121
int rows = 0;

0 commit comments

Comments
 (0)