I’m using emacs terminal emulator. GNU Emacs 23.2.1 with GNU bash, version 3.00.0(1)-release.
When some command, say grep 1 file.txt prints very long lines, emacs trunkate them to fit the window width.
But it do that right with that lines, so when I copy such line, i get not single long line, but several eaqually-width lines.
For example:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
After echoing it, say with cat lorem.ipsum
I get (if i have a 38-character wide terminal):
Lorem ipsum dolor sit amet, consectet
ur adipisicing elit, sed do eiusmod t
empor incididunt ut labore et dolore
magna aliqua.
And now, if I copy it from the terminal, I will have 4 lines separated with \n characters.
It is very annoying, how to dispose of it?
Actually I didn’t found the answer, but I’ve wirtten a quick hack for easy pasting such cuts into the term:
And then, the binging for C-y (I use the multi-term extension).