ANSI color codes, boldfacing, and various other control codes for
linefeeds is being captured literally with wl-copy and faithfully
reproduced when pasting. This behaviour deviates from copy/paste using
a mouse. If the terminal is showing text that is colored and
formatted, and the mouse is used to select a string of text which is
then pasted into emacs or a pastebin form, the control characters are
stripped out uncolored raw text is pasted. The wl-copy tool should be
able to simulate that.
This can easily be reproduced using the “script” command to capture a
typescript, as follows:
$ script
$ [do anything arbitrary here, such as “man wl-clipboard”]
$ <control-d>
$ file typescript
typescript: Unicode text, UTF-8 text, with CRLF, CR, LF line terminators, with escape sequences, with overstriking
$ wl-copy -p < typescript
When pasting into a place where raw text is expected, control codes
appear. Whereas if you use a mouse to do the copy, the paste is raw
text. So it would be useful if wl-copy had an option to simulate the
mouse action.