Ref T12822. This is an objectively good change, although I'm not planning to pursue it to completion right now.
This roughly demonstrates how we can improve "\t", ZWS, etc., behavior in the future by showing one thing and copying something else: we can show something that's easy to read, and copy the authentic original text.
There are a few issues with this, and a real implementation would be a bit messier:
- This puts the replacement text on the <td>, but you can select one single character and the <td> won't (I think?) be part of your selection. But if you just copy some whitespace or a single sheep or whatever, it's probably fine that your clipboard ends up with exactly what you copied -- it's probably only really important/valuable to preserve the original text when you're copying larger blocks.
- You can copy half a line, and we'll currently put the entire line on your clipboard. This gets even trickier when the original and replacement text have different numbers of characters (e.g., "\t" -> multiple spaces).
- When you copy part of a line, it might be at the beginning or end of your selection, so when we're putting part of a replacement text onto the clipboard, we need to figure out if we're supposed to take from the beginning or end of the replacement text.
Anyway, this is on the table in the future for dealing with these sorts of issues, although I don't plan to pursue it for now.