views:

254

answers:

1

I read the following code in Unix Power Tools on page 117

 *VT100.Translations: #override\
     Button1 <Btn3Down>: select-end(primary,CUT_BUFFER0,CLIPBOARD)\n\
     !Shift <Btn2Up>: insert-selection(CLIPBOARD)\n\
     ~Shift ~Ctrl ~Meta <Btn2Up>: insert-selection(primary,CUT_BUFFER0)

I have not managed to see any effect of the above code.

How can you use X clipboard in Screen, without your mouse?

+1  A: 

Using the mouse. Left-click drag to select and usually the middle mouse button pastes but some terminals may differ (PuTTY uses right-click). If you only have two buttons you click them both together (left mouse button + right mouse button).

In reply to comment below ("Can you do it without your mouse?"):

ctrl-insert : copy

shift-insert : paste

shift-delete : cut

shift-ctrl-C : copy

shift-ctrl-V : paste

Not all applications will support the last three (though Konsole does). In fact most console applications will not allow you to delete text once it's printed.

As far as selecting text without a mouse I'm not sure there's a generic mechanism for that. It's probably terminal and/or application specific (ie, vim has it's own keys for marking and copying text - but only within vim). You could do it with mouse emulation but I'm sure that would be a painful process.

You can't use the traditional Mac/Windows shortcuts in a terminal because they were reserved for different actions long before these OS existed (ie, Ctrl-C terminates the running process).

I'm trying to use Ctrl-C in X

X does not handle these operations directly, they are handled by the application. That's why modern GUI programs like Firefox or Gedit support Ctrl-C for copy but terminals and command-line programs generally do not. As I said, it's a conflict in established conventions and Ctrl-C for kill got in first.

BTW, you could do some key-remapping if it drives you nuts but then you would be learning bad habits when you use a different machine. Best to just get used to it or do most of your editing in a GUI application.

More Information

EDIT: For a Mac, this may help: MacOSX-to-Konsole or This or This. It looks like you need to replace Ctrl with Command on Mac keyboards. It seems like Terminal the mac console has a right-click context menu for copy-paste so to do it the traditional way you me need to install a different console program or change some settings in Terminal.

SpliFF
Can you do it without your mouse?
Masi
I have no insert in my Mac, although I have it in my keyboard. It seems that I should remap the keybinding.
Masi
Or use a console application that supports shift-ctrl-c. Also I find it unlikely you would have Insert on your keyboard but it doesn't work.
SpliFF
You waited all this time to tell me it's a Mac?Anyway it isn't that hard to just use the mouse. You need it to select the text so all you need to do is remember to also use it for pasting in the console. Mac mouse are two-button these days aren't they? Pressing both buttons together should paste anything you selected in a console.
SpliFF
@SpliFF: Thank you Spliff! I have been looking for long time for the third button in my mouse.
Masi
No problem. If the double button thing is a hassle I'm pretty sure you can plug in any PC USB mouse for those extra buttons. I couldn't live without a scroll wheel these days.
SpliFF
@SpliFF: True! I cannot live without two scroll wheels :) I use MX revolution. However, it works much better in Ubuntu than in Mac.
Masi
Also, if the left+right click for paste doesn't work in X11, look for 3-mouse-button emulation support.Under OSX, the X11 emulator has a preference pane to enable it.
zimbatm
@Masi. This question would appear to be answered, please don't forget to mark it as accepted or half the bounty is lost.
SpliFF

related questions