mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-14 06:48:39 -04:00
Remove set_cursor_state, let's not overcomplicate things for now
This commit is contained in:
parent
449d7490ac
commit
34a03061fe
@ -43,8 +43,6 @@ class console_writer : public logger {
|
|||||||
level_type threshold, display_mode mode = NORMAL,
|
level_type threshold, display_mode mode = NORMAL,
|
||||||
bool verbose = false);
|
bool verbose = false);
|
||||||
|
|
||||||
~console_writer();
|
|
||||||
|
|
||||||
void write(level_type level, const std::string& output, char const* file,
|
void write(level_type level, const std::string& output, char const* file,
|
||||||
int line) override;
|
int line) override;
|
||||||
|
|
||||||
|
@ -50,8 +50,6 @@ void setup_terminal();
|
|||||||
|
|
||||||
bool stream_is_fancy_terminal(std::ostream& os);
|
bool stream_is_fancy_terminal(std::ostream& os);
|
||||||
|
|
||||||
bool set_cursor_state(bool enabled);
|
|
||||||
|
|
||||||
char const* terminal_color(termcolor color);
|
char const* terminal_color(termcolor color);
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
@ -75,11 +75,8 @@ console_writer::console_writer(std::ostream& os, progress_mode pg_mode,
|
|||||||
} else {
|
} else {
|
||||||
set_policy<prod_logger_policy>();
|
set_policy<prod_logger_policy>();
|
||||||
}
|
}
|
||||||
set_cursor_state(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console_writer::~console_writer() { set_cursor_state(true); }
|
|
||||||
|
|
||||||
void console_writer::rewind() {
|
void console_writer::rewind() {
|
||||||
if (!statebuf_.empty()) {
|
if (!statebuf_.empty()) {
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
|
@ -58,21 +58,6 @@ void WindowsEmulateVT100Terminal(DWORD std_handle) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool set_cursor_state(bool enabled [[maybe_unused]]) {
|
|
||||||
bool was_enabled = true;
|
|
||||||
#ifdef _WIN32
|
|
||||||
auto hdl = ::GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
|
|
||||||
::CONSOLE_CURSOR_INFO cursorInfo;
|
|
||||||
|
|
||||||
::GetConsoleCursorInfo(hdl, &cursorInfo);
|
|
||||||
was_enabled = cursorInfo.bVisible;
|
|
||||||
cursorInfo.bVisible = enabled;
|
|
||||||
::SetConsoleCursorInfo(hdl, &cursorInfo);
|
|
||||||
#endif
|
|
||||||
return was_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup_terminal() {
|
void setup_terminal() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WindowsEmulateVT100Terminal(STD_OUTPUT_HANDLE);
|
WindowsEmulateVT100Terminal(STD_OUTPUT_HANDLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user