cleanup to restore main screen buffer
| 317 | |
| 318 | // cleanup to restore main screen buffer |
| 319 | void Screen::cleanup() |
| 320 | { |
| 321 | #ifdef OS_WIN |
| 322 | |
| 323 | if (hConOut != INVALID_HANDLE_VALUE) |
| 324 | { |
| 325 | // disable alternative scroll and screen buffer |
| 326 | put("\033[1;1H\033[2J\033[m\033[?1007l\033[?1049l"); |
| 327 | |
| 328 | SetConsoleMode(hConOut, oldOutMode); |
| 329 | |
| 330 | CloseHandle(hConOut); |
| 331 | } |
| 332 | |
| 333 | #else |
| 334 | |
| 335 | // remove window resize signal handler |
| 336 | signal(SIGWINCH, SIG_DFL); |
| 337 | |
| 338 | // disable alternative screen buffer |
| 339 | put("\033[1;1H\033[2J\033[m\033[?1049l"); |
| 340 | |
| 341 | #endif |
| 342 | } |
| 343 | |
| 344 | // return character display width, 0 (non-spacing or invalid character), 1 (single width) or 2 (double width) |
| 345 | int Screen::wchar_width(uint32_t wc) |
nothing calls this directly
no outgoing calls
no test coverage detected