|
|
Subscribe / Log in / New account

Clipboard selection

Clipboard selection

Posted Apr 5, 2018 10:09 UTC (Thu) by grawity (subscriber, #80596)
In reply to: Clipboard selection by eru
Parent article: A look at terminal emulators, part 1

You can actually bind the same keys in xterm via ~/.Xresources:

XTerm*vt100.translations:	#override			\n\
	Shift Ctrl <Key>C:	copy-selection(CLIPBOARD)	\n\
	Shift Ctrl <Key>V:	insert-selection(CLIPBOARD)	\n\
	Shift Ctrl <Key>N:	spawn-new-terminal()		\n

(If you wanted to do the same in urxvt, you would need to load a perl script into it.)


to post comments

Clipboard selection

Posted Apr 7, 2018 11:05 UTC (Sat) by eru (subscriber, #2753) [Link]

Thanks! Now I can go back to the One True Terminal Emulator. Only problem is some of that stuff is not supported on older xterm versions. The copy-selection appears in patch Patch #267 - 2010/11/20 (https://invisible-island.net/xterm/xterm.log.html), the RHEL/CentOS bundled ones (which I often need to use) may be older, depending on the particular RHEL version. But on non-ancient distributions your solution works fine.

Clipboard selection

Posted Apr 17, 2018 19:26 UTC (Tue) by Ross (guest, #4065) [Link]

Or if you liked Macs, Motif (probably not), or other non-Windows systems, or just don't like using two modifiers, "alt" makes a nice choice:

Alt <KeyPress>c: select-set(CLIPBOARD)\n\
Alt <KeyPress>v: insert-selection(CLIPBOARD)\n\

If you like to use PRIMARY selections (highlight/middle-click), you might find that alt-spacebar is a convenient way to paste:

Alt <KeyPress>space: insert-selection(PRIMARY,CUT_BUFFER0)\n\

(CUT_BUFFER0 is a fallback there to the old cut buffer system which is useless except it works after the source window has been closed if it supports cut buffers, which xterm does)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds