This is similar to How can I copy text from xterm (Awesome, Debian, VirtualBox)?, including part of the suggested answer.
However: by way of background, xterm receives X events (which you can see using xev), and handles those in different ways:
- for controlinsert, xterm sees the events for the control- and insert-keys, and constructs a sequence of characters to send to your application, e.g.,
^[[28;5~
- shiftinsert is handled differently because it is part of the default
translations resource for xterm. That is a feature of the X Toolkit library which comes before xterm can see the events. In the translations resource, that is this line:
Shift Insert:insert-selection(SELECT, CUT_BUFFER0) \n\
The SELECT keyword in this resource is interpreted by xterm to be either PRIMARY or CLIPBOARD, depending on the selectToClipboard resource (or the Select to Clipboard menu entry). By the way, CLIPBOARD is not the secondary selection. See 2.6.1.2. The SECONDARY Selection in the ICCM for a description of the secondary selection.
You can enable the selectToClipboard resource by adding this to your $HOME/.Xdefaults file (or other resource file, even using xrdb):
xterm*selectToClipboard: true
You can also add translations using control and shift modifiers (in either order), and the insert key. Adapting my answer in the other question:
xterm*VT100.Translations: #override \
Shift <Key>Insert: insert-selection(SELECT) \n\
Ctrl <Key>Insert: copy-selection(SELECT) \n\
Ctrl Shift <Key>V: insert-selection(SELECT) \n\
Ctrl Shift <Key>C: copy-selection(SELECT)
The translations parser in X Toolkit recognizes a variety of spellings for the keywords. Thus Key is the same as KeyPress and KeyDown. But Ctrl is the only way it knows for the control key.
While you could add controlC and controlV, this is generally not recommended because those control keys are useful (by default) in your terminal:
$ stty -a
speed 38400 baud; rows 40; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
Further reading: