Bug: Copying multi-line colored text from SSH terminal drops whitespace characters
Hello,
I would like to report a bug regarding the copy and paste behavior in the SSH terminal session. When copying multiple lines of output that contain colored text, some whitespace characters are dropped upon pasting.
This issue seems to be directly related to the handling of ANSI color escape sequences during multi-line selection.
Environment:
Issue Description & Actual Behavior:
When I execute a command that outputs colored text (e.g., ip route) and copy the multi-line result, the spaces surrounding the colored elements are missing when pasted.
Here is the exact pasted result of the multi-line copy (spaces are missing):
[usr01@xxxx00 ~]$ ip route default via10.10.1.1devenp0s5proto dhcp src10.10.1.250metric 100 10.10.1.0/24devenp0s5proto kernel scope link src10.10.1.250metric 100 169.254.0.0/16devenp0s5proto dhcp scope link src10.10.1.250metric 100 [usr01@xxxx00 ~]$
And here is the actual terminal display showing the commands being executed (please see the attached image for color reference):
Expected Behavior (and Workarounds):
The spaces should be preserved. I found that the issue does not occur in the following scenarios:
1. When piping the output to cat (which removes ANSI colors):
Copying the multi-line result of ip route | cat works perfectly (as shown in the bottom half of the image).
[usr01@xxxx00 ~]$ ip route | cat default via 10.10.1.1 dev enp0s5 proto dhcp src 10.10.1.250 metric 100 10.10.1.0/24 dev enp0s5 proto kernel scope link src 10.10.1.250 metric 100 169.254.0.0/16 dev enp0s5 proto dhcp scope link src 10.10.1.250 metric 100 [usr01@xxxx00 ~]$
2. When copying a single line (without line breaks):
Selecting and copying just one colored line preserves the spaces.
10.10.1.0/24 dev enp0s5 proto kernel scope link src 10.10.1.250 metric 100
Could you please investigate this issue with ANSI color handling during multi-line copy?
Thank you.
2026-06-12_11h28_12.png
Special Q&A A rare opportunity — ask our CTO directly.