I've been fairly happily using Ctrl-C/Ctrl-V, with the occasional Ctrl-Ins/Shift-Ins here and there on Linux for quite some time, but I've recently switched over to urxvt and am finding the clipboard interaction situation pretty intolerable.

I would simply switch back to another emulator, but I'd rather have a go at solving this first.

Right now, I'm using autocutsel to sync CLIPBOARD and PRIMARY, but while this works well for copying text from urxvt to most other apps, it generally degrades the overall usefulness of the clipboard because it gets accidentally overwritten any time I select text anywhere.

The ideal solution would be to disable the PRIMARY "copy on select" behavior system-wide but Googling hasn't found me a solution. This question discusses it, but sadly remains unanswered.

To summarize, desired behavior:

  • urxvt
  • selection: no-op
  • Ctrl-Ins: copies to PRIMARY (autocutsel syncs to CLIPBOARD)
  • Shift-Ins: pastes from PRIMARY

  • elsewhere

  • selection: no-op
  • Ctrl-C: copies to CLIPBOARD (autocutsel syncs to PRIMARY)
  • Ctrl-V: pastes from CLIPBOARD

NOTE: Please let me know if I'm misunderstanding either what Ctrl-Ins/Shift-Ins do or how autocutsel works.

EXTRA NOTE: There is another similar question that's been answered here but that is about doing exactly the opposite (disabling CLIPBOARD) which will result in copying being implicit rather than explicit; as it says in that answer:

You can ignore PRIMARY if you want (but note that some older applications like xterm may only support PRIMARY

So the specific problem here is (a) supporting the modern explicitly populated CLIPBOARD while (b) still retaining access clipped contents from older applications

  • I don't understand your approach. If you never want selecting to copy, why don't you completely ignore the primary selection, and only ever use the clipboard? – Gilles 'SO- stop being evil' Oct 4 '15 at 22:37
  • @Gilles this works fine as long as you avoid using apps that only use PRIMARY, like urxvt. (note: I believe more recent urxvt versions have actually added limited CLIPBOARD support using Ctrl-Shift-V/Ctrl-Shift-C but this appears to be unreliable and conflicts with other shortcuts, especially in Vim) – lucideer Oct 5 '15 at 6:48

Browse other questions tagged or ask your own question.