MCPcopy Create free account
hub / github.com/Genivia/ugrep / cleanup

Method cleanup

src/screen.cpp:319–342  ·  view source on GitHub ↗

cleanup to restore main screen buffer

Source from the content-addressed store, hash-verified

317
318// cleanup to restore main screen buffer
319void 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)
345int Screen::wchar_width(uint32_t wc)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected