Skip to content

Commit

Permalink
Fix extra empty lines in serial monitor with small hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Koromix committed Dec 1, 2019
1 parent 0b18c1f commit c874426
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tycommander/board.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,11 @@ void Board::appendBufferToSerialDocument()
serial_buf_len_ = 0;
locker.unlock();

// Hack to fix extra empty lines when CR and LF are put in separate buffers.
// That's something that will go away with VT-100 support.
if (str.endsWith('\r'))
str.resize(str.size() - 1);

QTextCursor cursor(&serial_document_);
cursor.movePosition(QTextCursor::End);
cursor.insertText(str);
Expand Down

0 comments on commit c874426

Please sign in to comment.