diff --git a/src/Screen.cpp b/src/Screen.cpp index 0616215a..f925ddfd 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -1229,6 +1229,15 @@ int Screen::copyLineToStream(int line , Character* data = screenLines[screenLine].data(); int length = screenLines[screenLine].count(); + // ignore trailing white space at the end of the line + for (int i = length-1; i >= 0; i--) + { + if (data[i].character == ' ') + length--; + else + break; + } + //retrieve line from screen image for (int i=start;i < qMin(start+count,length);i++) {