Xterm and the clipboard

It has long been an annoyance that xterm doesn’t follow the same rules with regard to the clipboard as most GTK/Gnome applications.

Xterm by default only uses the PRIMARY selection for copy and paste, and follows the implicit selection model where the selection is set immediately when text is selected with the mouse, without any further action from the user.

Most GTK/Gnome applications uses both an implicit selection model with the PRIMARY selection, and an explicit selection model with the CLIPBOARD selection.

I don’t know of any way to get xterm to behave like most other applications, but this little set of X ressources will enable the use of the CLIPBOARD selection in xterm, when the Shift key is down.

XTerm*VT100.Translations:    #override
	Shift<Btn1Down>:		select-start()

	Shift<Btn1Motion>:		select-extend()

	Shift<Btn1Up>:			select-end(CLIPBOARD)

	Shift<Btn2Up>:			insert-selection(CLIPBOARD)

	Shift<Btn3Down>:		start-extend()

	Shift<Btn3Motion>:		select-extend()

	Shift<BtnUp>:			select-end(CLIPBOARD)

Tags: , ,

One Response to “Xterm and the clipboard”

  1. BigSmoke » Copy-pasting to and from XTerms Says:

    […] Xterm and the clipboard by RenĂ© Seindal […]

Leave a Reply

You must be logged in to post a comment.