Sometimes terminal cells contain runes with code 0x0000 (which seems ok). But when putting such a text with embedded zeroes into clipboard the text was cut on the first zero rune. So, now those zero runes are replacing with spaces when putting text to clipboard.
Also, I did some refactoring and used strings.Builder instead of concatenating the string, in order to minimize memory allocations.
Fixes #169
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Run Aminal on Windows and SSH to a Linux box (this increases the possibility of zero runes).
Select several lines on the screen and press Ctrl+Shift+C to copy the selected text
Open notepad and press Ctrl+V there. See that all the selected text is pasted from the clipboard.
Description
Sometimes terminal cells contain runes with code 0x0000 (which seems ok). But when putting such a text with embedded zeroes into clipboard the text was cut on the first zero rune. So, now those zero runes are replacing with spaces when putting text to clipboard. Also, I did some refactoring and used
strings.Builder
instead of concatenating the string, in order to minimize memory allocations.Fixes #169
Type of change
How Has This Been Tested?
Ctrl+Shift+C
to copy the selected textnotepad
and pressCtrl+V
there. See that all the selected text is pasted from the clipboard.Test Configuration:
any supported