diff options
author | James McCoy <jamessan@debian.org> | 2014-12-07 22:15:36 -0500 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2015-08-16 16:59:47 +0200 |
commit | 45b19add6c4d95a5feca5e710e1a080be6cee4c2 (patch) | |
tree | 6ef7c5ceba4992966db5e45de0707bc62c590d30 /apt-pkg/install-progress.cc | |
parent | 0e54edd2eda54637596d620a31abb3131ad0a6b4 (diff) |
Use terminfo's typical save_cursor/restore_cursor sequences
Not all terminals understand DOS' escape sequences for save/restore
cursor, so use the more typical sequences from terminfo.
Closes: #772521
Signed-off-by: James McCoy <jamessan@debian.org>
Diffstat (limited to 'apt-pkg/install-progress.cc')
-rw-r--r-- | apt-pkg/install-progress.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index ff3f652e5..58e552474 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -287,13 +287,13 @@ void PackageManagerFancy::SetupTerminalScrollArea(int nr_rows) std::cout << "\n"; // save cursor - std::cout << "\033[s"; + std::cout << "\0337"; // set scroll region (this will place the cursor in the top left) std::cout << "\033[0;" << nr_rows - 1 << "r"; // restore cursor but ensure its inside the scrolling area - std::cout << "\033[u"; + std::cout << "\0338"; static const char *move_cursor_up = "\033[1A"; std::cout << move_cursor_up; @@ -375,8 +375,8 @@ bool PackageManagerFancy::DrawStatusLine() if (unlikely(size.rows < 1 || size.columns < 1)) return false; - static std::string save_cursor = "\033[s"; - static std::string restore_cursor = "\033[u"; + static std::string save_cursor = "\0337"; + static std::string restore_cursor = "\0338"; // green static std::string set_bg_color = DeQuoteString( |