You are not logged in.

#1 2011-06-29 19:04:27

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 73

urxvt: ctrl+shift+c and ctrl+shift+v

Hello,

I've a question about urxvt: I'd like to be able to copy and paste in the program using ctrl+shift+c and ctrl+shift+v, as can be done in most other terminal emulators. Does anyone know of a way to do this, preferably in a simple manner?

I'm aware that this is probably simply not the preferred Linux way or something, but I just cannot get used to the whole select text+middle mouse button convention... How is that functional, anyway? I suppose it's faster, but what if you want to replace some text in a Firefox text field? First delete all the text with backspace and then paste with the middle mouse button? I'd rather select the existing text and paste over it, myself... Am I overlooking something here? (Something vim-ish? smile )

I know of the Clipboard Management applications on the urxvt Wiki page, but I don't want to synchronize my primary and clipboard selection; I'd rather not use the primary selection at all, really. Or does this simply make urxvt not suitable for me?


...Am I being influenced by too much past Windows use? smile

Offline

#2 2011-06-29 19:10:09

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,133

Re: urxvt: ctrl+shift+c and ctrl+shift+v

Ctrl+Shift+C works for copying by default, pasting only works through middle click in urxvt.

As for the Firefox text field, you do a Ctrl+A to select all the text in the field. Then hit Backspace or Delete and then middle mouse to paste what you copied from urxvt.

I believe Shift+Delete & Shift+Insert works as well.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-06-29 19:18:04

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 73

Re: urxvt: ctrl+shift+c and ctrl+shift+v

Does it? It doesn't, for me... Ctrl+shift in urxvt activates the "keycap picture insert mode" - which, by the way, has only resulted in unwanted behaviour for me so far - and pressing c after that results in an orange screen in the lower-left corner saying something about c being a "built-in support font".

It doesn't copy, though.

EDIT: Hey, you edited your post. Hum. To respond to the rest: Isn't the primary selection overwritten when you press ctrl+a? And what if you only want to replace part of the text?

I'll try shift+del & shift+ins, thanks smile

Last edited by STEELBAS (2011-06-29 19:20:21)

Offline

#4 2011-06-29 19:24:20

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,133

Re: urxvt: ctrl+shift+c and ctrl+shift+v

for me ctrl+shift+c copies the selected text from urxvt, and then erases everything from urxvt and gives me a clean prompt. However, its unnecessary since selecting itself copies the text


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2011-06-29 19:33:25

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 73

Re: urxvt: ctrl+shift+c and ctrl+shift+v

I'm aware of that, but it copies the selected text into the primary selection, whereas I would prefer being able to have some way of copying the selected text to the clipboard selection, which is usually ctrl+shift+c in other terminal emulators.

I.e. when I select some text in urxvt now (and press ctrl+shift+c, if you like) and then press ctrl+v in Opera, the text I selected is not pasted. I am aware that pressing the middle mouse button would paste the text as expected, but I want to be able to copy text to the clipboard selection from urxvt without having to synchronise my primary selection and clipboard selection with one of the programs mentioned on the urxvt Wiki page.

I'm sorry if I'm not being clear.. I'm having a hard time describing exactly what I want to achieve here, it seems smile

EDIT: ctrl+del pastes the primary selection in urxvt, by the way. Not the clipboard selection. ctrl+ins does not appear to do anything.

Last edited by STEELBAS (2011-06-29 19:36:23)

Offline

#6 2011-06-30 00:38:08

rockin turtle
Member
From: Montana, USA
Registered: 2009-10-22
Posts: 227

Re: urxvt: ctrl+shift+c and ctrl+shift+v

Maybe this will give you some ideas.

Also this guy has some useful perl scripts that can help. Put the scripts in /usr/lib/urxvt/perl, and modify your .Xdefaults file to use the keyboard shortcuts you wish.  This is in my .Xdefaults:

URxvt.keysym.M-c:   perl:clipboard:copy
URxvt.keysym.M-v:   perl:clipboard:paste

I can select with the mouse, Alt-c copies to the clipboard, then Alt-v copies the text.  If I am copying to Firefox, Firefox grabs the Alt-v to desplay a menu, so I can use Ctrl-v instead.

Edit: Don't forget to do

$ xrdb -merge ~/.Xdefaults

after you modify your .Xdefaults for the changes to take affect.

Last edited by rockin turtle (2011-06-30 00:40:46)

Offline

#7 2011-06-30 10:13:49

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 73

Re: urxvt: ctrl+shift+c and ctrl+shift+v

Oh. I'd completely overlooked those threads. I didn't look hard enough, it seems. Thanks!

For if anyone else wants to do this: Not only do you need to add

URxvt.keysym.M-c:   perl:clipboard:copy
URxvt.keysym.M-v:   perl:clipboard:paste

to your .Xresources, you also need to add clipboard to the line with "URxvt.perl-ext-common:".
E,g,:

URxvt.perl-ext-common:  default,tabbed,clipboard

Maybe this deserves an entry on the Wiki...

Last edited by STEELBAS (2011-06-30 22:38:31)

Offline

#8 2011-06-30 22:45:33

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 73

Re: urxvt: ctrl+shift+c and ctrl+shift+v

This, unfortunately, does not work:

URxvt.keysym.Control-Shift-c:   perl:clipboard:copy
URxvt.keysym.Control-Shift-v:   perl:clipboard:paste

Which, admittedly, is not very surprising. Nevertheless, does anyone know if that could be made possible? Just for kicks, really smile

Offline

#9 2012-01-26 15:42:24

sgtpep
Member
Registered: 2011-12-22
Posts: 28

Re: urxvt: ctrl+shift+c and ctrl+shift+v

@STEELBAS Are you using urxvt daemon/client approach? It seems like restarting of urxvtd is required to apply the custom shortcuts.

Offline

#10 2012-12-17 10:53:39

sgtpep
Member
Registered: 2011-12-22
Posts: 28

Re: urxvt: ctrl+shift+c and ctrl+shift+v

Ctrl+Shift+C and others works for me with this configuration:

URxvt.keysym.C-C: perl:clipboard:copy
URxvt.keysym.C-V: perl:clipboard:paste
URxvt.keysym.C-A-V: perl:clipboard:paste_escaped

Offline

#11 2012-12-17 11:23:15

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: urxvt: ctrl+shift+c and ctrl+shift+v

sgtpep wrote:

Ctrl+Shift+C and others works for me with this configuration:

URxvt.keysym.C-C: perl:clipboard:copy
URxvt.keysym.C-V: perl:clipboard:paste
URxvt.keysym.C-A-V: perl:clipboard:paste_escaped

It works if urxvt is compiled with --disable-iso14755, which is responsible for this little yellow box for inputting unicode symbols.


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#12 2012-12-19 23:44:15

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 98

Re: urxvt: ctrl+shift+c and ctrl+shift+v

kaszak696 wrote:
sgtpep wrote:

Ctrl+Shift+C and others works for me with this configuration:

URxvt.keysym.C-C: perl:clipboard:copy
URxvt.keysym.C-V: perl:clipboard:paste
URxvt.keysym.C-A-V: perl:clipboard:paste_escaped

It works if urxvt is compiled with --disable-iso14755, which is responsible for this little yellow box for inputting unicode symbols.


or set
URxvt.iso14755 : false

Offline

Board footer

Powered by FluxBB