For historical reasons, there are two selections¹, with different usage conventions:
- The PRIMARY selection automatically changes when you highlight some text with the mouse. There is no “copy” command, it's automatic.
- The CLIPBOARD selection changes only when you issue a “copy” command (keyboard shortcut or icon or menu entry).
Classic X11 applications such as urxvt support PRIMARY only. Modern X11 applications such as anything using Gtk/Gnome or Qt/KDE support CLIPBOARD and often, but not always, PRIMARY. The unfortunate consequence is that you can't directly copy-paste between CLIPBOARD-only applications and PRIMARY-only applications, and you can't easily copy-paste between CLIPBOARD-preferring applications and PRIMARY-only applications.
If you highlight text with the mouse in urxvt, you can paste it in Abiword with the middle mouse button (whereas the keyboard shortcut would paste the CLIPBOARD).
If you need to transfer text between selections, you have several methods:
- Use a GUI clipboard manager (Autocutsel, XFCE Clipmap, Gnome Glipper, KDE Klipper, Parcellite, …).
- Paste into an intermediate application that supports both and copy again.
Use the command-line program xclip or xsel to copy the PRIMARY selection into the CLIPBOARD or vice versa.
xclip -selection primary -o | xclip -selection clipboard -i
xsel | xsel -b
xclip -selection clipboard -o | xclip -selection primary -i
xsel -b | xsel
¹ Even more, in fact, but only two that you'd encounter on a regular basis.
There's nothing built in, exactly, but there are two ways to get at the scrollback text.
You can configure the XTerm.vt100.on4Clicks
and XTerm.vt100.on5Clicks
resources (or from on1Clicks
onwards, for that matter) to choose to copy the whole scrollback to the X11 PRIMARY selection. For example, to copy the whole scrollback on a quadruple click, put this line in your .Xresources
:
XTerm.vt100.on4Clicks: all
You'll then have to arrange your own method for bringing up some way to search the content of the X selection, such as opening an editor or a pager with a window manager binding.
You can call the print-everything
action to send the whole scrollback to a program determined by the XTerm.vt100.printerCommand
resource. For example, to open the scrollback in less (running in a new xterm) when you press Ctrl+/, put these lines in your .Xresources
:
XTerm.vt100.printerCommand: xterm -e sh -c 'less <&3' 3<&0
XTerm.vt100.translations: #override Ctrl ~Meta ~Shift <Key>slash: print-everything()
Best Answer
xterm, whose conventions were established many years before Firefox, and even the web, was invented, is controlled by application resources. These are merged from several places, including files like
/usr/share/X11/app-defaults/XTerm
, and also information held by the X11 server seen withxrdb -q
. You can override these resources by placing, for example, things like the following in the file~/.Xdefaults
:This binds ctrl-shift-v to inserting the clipboard contents. I'm not clear exactly what you wanted, so check the man page for the functions and the PRIMARY, SECONDARY and CUT_BUFFER0 selections.
You can presumably add (don't forget the backslash on preceding lines):