mirror of
https://github.com/GOSTSec/sgminer
synced 2025-09-04 18:21:54 +00:00
Win32: Fix for mangled output on the terminal on exit.
This commit is contained in:
parent
d37c3fe56b
commit
e04aee24d3
18
main.c
18
main.c
@ -993,6 +993,11 @@ static void workio_cmd_free(struct workio_cmd *wc)
|
|||||||
static void disable_curses(void)
|
static void disable_curses(void)
|
||||||
{
|
{
|
||||||
if (test_and_clear(&curses_active)) {
|
if (test_and_clear(&curses_active)) {
|
||||||
|
#ifdef WIN32
|
||||||
|
leaveok(logwin, false);
|
||||||
|
leaveok(statuswin, false);
|
||||||
|
leaveok(mainwin, false);
|
||||||
|
#endif
|
||||||
nocbreak();
|
nocbreak();
|
||||||
echo();
|
echo();
|
||||||
delwin(logwin);
|
delwin(logwin);
|
||||||
@ -1000,6 +1005,19 @@ static void disable_curses(void)
|
|||||||
delwin(mainwin);
|
delwin(mainwin);
|
||||||
endwin();
|
endwin();
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
// Move the cursor to after curses output.
|
||||||
|
HANDLE hout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
|
COORD coord;
|
||||||
|
|
||||||
|
if (GetConsoleScreenBufferInfo(hout, &csbi)) {
|
||||||
|
coord.X = 0;
|
||||||
|
coord.Y = csbi.dwSize.Y - 1;
|
||||||
|
SetConsoleCursorPosition(hout, coord);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user