Changeset 20014 for trunk


Ignore:
Timestamp:
12/28/20 14:59:35 (4 years ago)
Author:
tbretz
Message:
Improved handling of multiline cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Console.cc

    r18052 r20014  
    160160    if (newline)
    161161    {
    162         // Clear the line we are going to overwrite
     162        const size_t lines = GetLineLength()/GetCols();
     163
     164        size_t pos = GetAbsCursor()/GetCols();
     165
     166        // Go to last line
     167        for (; pos<lines; pos++)
     168            std::cout << "\n";
     169
     170        // Go to beginning of line and clear this line
    163171        std::cout << "\r\033[0K";
     172
     173        // Clear all previous lines
     174        while (pos--)
     175            std::cout << "\033[A\033[0K";
     176
    164177        fLogO.Display(true);
    165178    }
Note: See TracChangeset for help on using the changeset viewer.