Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Changes since last release

- Fixes

- Fix console bug under Linux: When opening TiGL, the console at first was spoiled with a warning and needed a fresh prompt for the user to enter commands [#1460](https://github.com/DLR-SC/tigl/issues/1460)
- Fix an issue that the header of the docu did not show the TiGL logo anymore due to the switch to a newer doxygen version internally [#1444](https://github.com/DLR-SC/tigl/issues/1444)
- Fix a crash when a control surface defines a `wingCutOut` ([#1454](https://github.com/DLR-SC/tigl/pull/1454))
- Fix a crash when the border of a leading edge device gives `xsiTEUpper` and `xsiTELower` instead of
Expand Down
19 changes: 19 additions & 0 deletions TIGLCreator/src/TIGLCreatorConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,28 @@ void Console::output(QString s)
setTextCursor(cursor);
_restorePosition = false;

// stray output while waiting at the prompt: remove the prompt line,
// keeping any text that was already typed there
bool stray = !_isLocked && !_isDirty;
QString typedText;
if (stray) {
cursor.select(QTextCursor::LineUnderCursor);
typedText = cursor.selectedText().mid(_prompt.length());
cursor.removeSelectedText();
cursor.deletePreviousChar();
}

s = s.replace("\n", "<br/>");
s = s.replace(" ", "&nbsp;&nbsp;");
appendHtml(QString("<font color=\"white\">%1</font><br/>").arg(s));
_isDirty = true;

if (stray) {
insertPrompt();
cursor = textCursor();
cursor.insertText(typedText);
_lastPosition = cursor.position();
}
}

void Console::outputError(QString s)
Expand Down Expand Up @@ -332,6 +350,7 @@ void Console::clear()

void Console::showHistory()
{
_isDirty = true;
int ihist = 0;
foreach (QString str, _history) {
str.remove(QChar(0x2028));
Expand Down
Loading