Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top