[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xterm copy-n-paste and mouse selection in scroll back



On Thu, 12 Dec 2002, Michael Heironimus wrote:

> On Wed, Dec 11, 2002 at 10:16:41PM -0800, Bill Moseley wrote:
> > 1) is there a way in xterm (or is it in X?) to copy to the clipboard? 
> > Not the PRIMARY (highlight & paste with center mouse), but rather the
> > CLIPBOARD (copy somehow?? and paste with shift+insert).
> 
> I'm not entirely sure I understand what you're asking. What is the
> distinction you're making between clipboard and selection?

>From what I have read (not much)  there's three "cut" buffers in X, a
PRIMARY, SECONDARY, and CLIPBOARD.  Applications control their use for
their own data.  The PRIMARY is activated when text is highlighted.  The
middle button "pastes" from this buffer (which I guess is not really a
buffer, rather one application requests a "paste" and the other
application that currently owns the PRIMARY returns the data to the
requesting application.)  The SECONDARY isn't used much, AFAIK.

The CLIPBOARD is (sometimes) used by applications -- this is more of a
Windows-type of clipboard with ctrl-C to copy and ctrl-V or shift-insert
to paste.

The PRIMARY type of cut-n-paste is handy and fast, but is a pain when you
need to replace some text on paste (since if you hightlight again the
current PRIMARY is lost.  With the CLIPBOARD its contents are not replaces
unitl there's an explicit "cut" operation.

I was just wondering if there was an xterm shortcut to "cut" to the
CLIPBOARD in xterm or xterm clone.


> In any case,
> shift-insert has always pasted the current selection in to xterm for me.

Oh, that's bad (no, not that it's been working for you -- that's good).
Cut-n-paste should be more standardized (IMHO) across apps.

Try this:  open mozilla to the debian mozilla start page (or pick a page
that has a form you can paste into).

Double-click on some text, right click and select Copy.  Now that's in the
Clipboard.  Now double-click a different bit of text and then move to a
form and they first paste with the middle button and you get that
currently highlighted text (from the PRIMARY).  Next type shift+ins and
now you will get the text in the CLIPBOARD.


> Things get more complex if you're trying to deal with other software,
> though. Some applications or desktop environments have their own
> clipboards independent of the X selection (is that what you're referring
> to?). Mozilla 1.1 seems to try to use both an internal clipboard AND the
> X selection simultaneously and ends up just being confusing and a
> nuisance.

That's not mozilla doing something different.  It's just making use of the
different X11 features.  It's handy if you know about it, but it's not
handy when applications are not consistent in their use -- such as Xterm
using shift-ins to paste from the PRIMARY and not from the CLIPBOARD.
Xterm is such a mature and well developed application I wonder if there's
not a way to change this behavior (for me, not for you ;).

> Select starting point (top or bottom) with left-mouse. Scroll. Click
> ending point with right-mouse to extend the selection.

Oh, cool, now I get it.  Thanks.

> > 3) Do any of the xterm clones allow searching the scroll-back buffer?
> 
> Don't know about this one, it's not something I normally need to do.

e.g. Run a long "make" and want to search back for something in the output
-- but didn't save output to a file.

Thanks, 


-- 
Bill Moseley moseley@hank.org



Reply to: