diff --git a/src/fenrirscreenreader/commands/commands/copy_marked_to_clipboard.py b/src/fenrirscreenreader/commands/commands/copy_marked_to_clipboard.py index ae21ffe1..caa37e6b 100644 --- a/src/fenrirscreenreader/commands/commands/copy_marked_to_clipboard.py +++ b/src/fenrirscreenreader/commands/commands/copy_marked_to_clipboard.py @@ -1,12 +1,9 @@ #!/bin/python # -*- coding: utf-8 -*- -# Fenrir TTY screen reader -# By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug from fenrirscreenreader.utils import mark_utils - class command(): def __init__(self): pass @@ -40,17 +37,17 @@ class command(): # First line (from start mark to end of line) firstLine = screenLines[startY] startX = min(startMark['x'], len(firstLine)) - result.append(firstLine[startX:]) + result.append(firstLine[startX:].rstrip()) # Middle lines (complete lines) for lineNum in range(startY + 1, endY): - result.append(screenLines[lineNum]) + result.append(screenLines[lineNum].rstrip()) # Last line (from start to end mark) if endY > startY: lastLine = screenLines[endY] endX = min(endMark['x'], len(lastLine)) + 1 - result.append(lastLine[:endX]) + result.append(lastLine[:endX].rstrip()) return '\n'.join(result)