mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-13 14:27:30 -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,
|
||||
bool verbose = false);
|
||||
|
||||
~console_writer();
|
||||
|
||||
void write(level_type level, const std::string& output, char const* file,
|
||||
int line) override;
|
||||
|
||||
|
@ -50,8 +50,6 @@ void setup_terminal();
|
||||
|
||||
bool stream_is_fancy_terminal(std::ostream& os);
|
||||
|
||||
bool set_cursor_state(bool enabled);
|
||||
|
||||
char const* terminal_color(termcolor color);
|
||||
|
||||
std::string
|
||||
|
@ -75,11 +75,8 @@ console_writer::console_writer(std::ostream& os, progress_mode pg_mode,
|
||||
} else {
|
||||
set_policy<prod_logger_policy>();
|
||||
}
|
||||
set_cursor_state(false);
|
||||
}
|
||||
|
||||
console_writer::~console_writer() { set_cursor_state(true); }
|
||||
|
||||
void console_writer::rewind() {
|
||||
if (!statebuf_.empty()) {
|
||||
int lines = 0;
|
||||
|
@ -58,21 +58,6 @@ void WindowsEmulateVT100Terminal(DWORD std_handle) {
|
||||
}
|
||||
#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() {
|
||||
#ifdef _WIN32
|
||||
WindowsEmulateVT100Terminal(STD_OUTPUT_HANDLE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user