You are not logged in.
Hi,
I'd like to change the key bindings in xterm for copy-paste to ctrl-c and ctrl-v rather than middle click and shift-insert.
Is there a way to do so?
Offline
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
By your second link, I imagine you mean that the copy-paste shortcuts can be redefined by a clipboard manager?
Hints found here:
- xbindkeys + parcellite/any other clipboard manager > still need to read
- xdotool > associate ctrl-c to the command "xdotool click 2". However I don't like this way of doing because depending on the application, ctrl-c may then behave differently.
Offline
Okay, here I am.
.xbindkeysrc:
"xdotool click 2"
control+shift+c
"xdotool Shift+Insert"
control+shift+v(with clipit, but that doesn't matter.)
Ctrl-shift-c works fine, ctrl-shift-v doesn't. xdotool Shift+Insert works fine too when it's directly typed in xterm.
Any hint?
Offline
xdotool Shift+Insert doesn't work for me. I think you want: "xdotool key Shift+Insert"
Last edited by Theta91 (2014-09-03 03:32:24)
Offline
Yeah I meant "xdotool key Shift+Instert".
I've found another way to paste but the bug is still the same:
when I "xdotool click 1" directly in xterm it yanks the selection in the clipboard and "xdotool click 2" pastes it.
Now if I write my .xbindkeysrc like
"xdotool click 1"
control+shift+c
"xdotool click 2"
control+shift+vthen:
ctrl-shift-c copies the selection to the clipboard and deselects it after;
ctrl-shift-v copies the selection to the clipboard without deselecting it;
typing manually "xdotool click 2" to the console still pastes what was copied by ctrl-shift-c and ctrl-shift-v.
Is there a way to directly remap the copy and paste functions inside an xterm config file, rather than passing through xbindkeys?
Edit: alternative way of doing. Adding a "paste from clipboard" functionality to zsh's vi mode. Will take a closer look tomorrow.
Last edited by lawrent (2014-09-05 02:03:55)
Offline
I use iocane now, but I reinstalled xbindkeys and xdotool to take a look, and it's completely non-functional for me in xterm.
In urxvt, however, everything works as expected (C-S-v pastes without deselecting). It seems likely that your problems are caused by xterm rather than xdotool+xbindkeys - perhaps try a better terminal?
Offline
Yeah, I wouldn't be surprised if the problem comes from xterm. Quoting the st terminal project,
What is wrong with xterm?
xterm is bloated and unmaintainable. Here’s an excerpt from the README:
Abandon All Hope, Ye Who Enter Here This is undoubtedly the most ugly program in the distribution. It was one of the first "serious" programs ported, and still has a lot of historical baggage. Ideally, there would be a general tty widget and then vt102 and tek4014 subwidgets so that they could be used in other programs. We are trying to clean things up as we go, but there is still a lot of work to do.Needless to say things have not changed, it’s still ugly. It has over 65K lines of code and emulates obscure and obsolete terminals you will never need. The popular alternative, rxvt has only 32K lines of code. This is just too much for something as simple as a terminal emulator; it’s yet another example of code complexity.
I'll have a closer look later on today, discovering the whole Linux universe is quite brain-intensive.
Offline