31 CONSOLE_SCREEN_BUFFER_INFO inf;
32 if(GetConsoleScreenBufferInfo(Private::out.handle(), &inf))
return Term::Cursor(
static_cast<std::size_t
>(inf.dwCursorPosition.Y + 1),
static_cast<std::size_t
>(inf.dwCursorPosition.X + 1));
41 if(!Private::out.null())
43 if(tcgetattr(Private::out.fd(), &actual) == -1) {
return {}; }
45 ::termios raw = actual;
47 raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
52 raw.c_lflag &= ~(ECHO | ICANON | IEXTEN);
56 if(!Private::out.null()) tcsetattr(Private::out.fd(), TCSAFLUSH, &raw);
58 while(nread == 0) { ::ioctl(Private::in.fd(), FIONREAD, &nread); }
60 tcsetattr(Private::out.fd(), TCSAFLUSH, &actual);
64 if(ret[0] ==
'\033' && ret[1] ==
'[' && ret[ret.size() - 1] ==
'R')
66 std::size_t found = ret.find(
';', 2);
67 if(found != std::string::npos) {
return Cursor(std::stoi(ret.substr(2, found - 2)), std::stoi(ret.substr(found + 1, ret.size() - (found + 2)))); }