Terminal that doesn't embed CR in copied text - is there one?
Chris G
cl at isbd.net
Sat Feb 7 11:18:28 UTC 2009
On Sat, Feb 07, 2009 at 03:17:33AM +0200, Marius Gedminas wrote:
> On Wed, Feb 04, 2009 at 04:10:20PM +0000, Chris G wrote:
> > I often cut/copy long chunks of text from terminal windows that
> > continue over multiple lines of the window. Is there any way to
> > prevent CRs being added to the pasted text?
>
> You could process the clipboard contents, e.g.
>
> $ xsel | tr '\n' ' ' | xsel
>
Hmm, makes a bit of a chore of cut and paste though! :-)
> > I'm sure this *used* to work "in the old days" but now I can't find
> > anywhere that it seems to work.
>
> I'm not familiar with any terminal emulator that did this, but maybe I'm
> just not old enough. ;)
>
It turns out that I was looking at "the wrong end", the newlines are
embedded in the string when it's *output* to the terminal. I was
particularly noticing it when copying ssh keys. When I output (for
example) the id_rsa.pub file I usually use 'more id_rsa.pub', this
embeds newlines in the output and if you triple click on the output
you just get one terminal wide chunk. However if I 'cat id_rsa.pub'
and triple click on the output it copies all the file which is several
'lines' on the terminal. Pasting this does what I want, it pastes the
whole key as a single line.
So "it used to work" because I used to use 'cat' to output the text! :-)
I can just use 'cat' now when I know I want to copy/paste long lines.
--
Chris Green
More information about the ubuntu-users
mailing list