24

For ages I've been using Putty when working with *nix servers, and I really got used to it's copy&paste method: select, left-click - for copy, just right-click - for paste.

How can I set Ubuntu terminal the same way? I see there is a shortcuts configuration, but it does not allow me to set keys I need. Ctrl+Shift+C, Ctrl+Shift+V is just braking my fingers.

I know there is a menu on right-click, but I don't need it.

snoop
  • 4,040
  • 9
  • 40
  • 58
  • Is there a reason why you do not install Putty in Ubuntu and just that instead of terminal? – Rinzwind May 15 '11 at 00:31
  • Great idea - just tried, but it didn't worked. Basically, keys are different under linux, and it does not copy on left mouse, and does not insert on right. In fact I haven't found any way to copy/paste on putty in Linux at all :-D – BarsMonster May 15 '11 at 00:40
  • I have tried the putty under ubuntu and looks awful. Keys are also not same as the windows putty. – Abhijeet May 15 '11 at 05:52
  • very strange... because whenever I have used Ubuntu ... this copy paste stuff is there by default...in terminal..in browser ..everywhere – abhishek Dec 21 '11 at 16:18
  • http://blog.tremende.com/2016/04/02/copy-on-select-and-right-click-paste-in-linux-terminal/ – mpapec Apr 07 '17 at 22:16

10 Answers10

21

I'm used to that feature too, that's why I use Ubuntu. All you need to do is open the terminal and type ssh myserver.gov.

For mega-fast copy-and-paste:

  • Select text to Copy
  • Middle-click to Paste
    • Middle-click is the mouse wheel click (or both mouse buttons)

It works with any selectable text in the OS: in the terminal, browser, ...

  • 3
    +1 Please note, however, by doing this mega-fast copy-and-paste, copied text is not copied to clipboard. Basically, you can do mouse copy-pasting while your clipboard holds a result of recent Ctrl+C. – Andrejs Cainikovs Dec 21 '11 at 16:49
  • 4
    +1 but I struggled to interpret this answer. The difference between PuTTY and the Ubuntu terminal is that you use Middle-click instead of Right-click to paste. – Waylon Flinn Oct 11 '12 at 15:34
  • Note that this does not work between virtual machines because it doesn't use the clipboard buffer. For this reason I stick to PuTTY and avoid the GUI terminal in my VMs. – Will Bickford Mar 25 '13 at 18:35
17

Ubuntu terminal (gnome-terminal) has this feature. It just uses Middle-click to paste instead of Right-click.

In summary:

  • Select the text to copy
  • Middle-click where you want to paste it
3

This is solved using either one of 2 methods:

  1. Using PuTTY linux version:

    Clicking in both Touchpad buttons I simulated the middle button. Since using Linux Mint distro, I had not this middle button simulation activated.

    (The latest version of evdev, version 2.5, changed the default for the middle mouse button emulation code. This change has disabled emulation of the middle mouse button by clicking the left and right mouse buttons) I needed to enable it manually:

    Enabling the middle mouse button emulation adding this to xorg.conf snippet:

        Section "InputClass"
           Identifier "middle button emulation class"
           MatchIsPointer "on"
           Option "Emulate3Buttons" "on"
        EndSection
    
  2. Using PuTTY Windows version:

    (I prefer this method since I do not need to change distro setting like Xorg, only Wine settings in order to connect to console serial ports):

    Since Wine handles com ports by having a link to the device (ie /dev/ttyUSB0), in the ~/.wine/dosdevices folder, this link would be created as follows, in order to update your wine profile configs:

    ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1
    

    I prefer this second method, since the copy paste works always, do not need the middle button simulation and, the sherry in the top of the cake, it NEVER hangs (occasionally PuTTY for Windows hangs on some winXP installations).

    Otherwise, in case you do not need/want to install wine, the first method is preferable.

Peachy
  • 7,117
  • 10
  • 38
  • 46
Joao
  • 31
  • 1
1

I use Ubuntu 16.04, gnome-shell and https://github.com/jrnewell/ubuntu-gnome-terminal-patch It works like Putty, as I see.

Origin is http://www.taika.org/~tomba/gnome-terminal/index.html

sasha-x
  • 21
1

I've liked the plain old xterm for this behaviour, so you may want to use that. It works just like that on my machine. Ubuntu has XTerm installed by default, and you can run it using the xterm command.

In fact, the way copying and pasting work in PuTTY was modelled after xterm. As the Configuring PuTTY page mentions:

PuTTY's copy and paste mechanism is modelled on the Unix xterm application. The X Window System uses a three-button mouse, and the convention is that the left button selects, the right button extends an existing selection, and the middle button pastes.

Windows typically only has two mouse buttons, so in PuTTY's default configuration, the right button pastes, and the middle button (if you have one) extends a selection.

If you have a three-button mouse...

Eliah Kagan
  • 117,780
Kjellski
  • 117
  • 4
0

Only solution that worked on my Dell under Ubuntu 16.04 is: SHIFT+INSERT. Depending on the program, CTRL+SHIFT+INSERT, might work as well.

Thanks https://superuser.com/a/111021/156771

tony gil
  • 283
0

Use some other terminal that supports that
Terminator is a good choice

Unnat
  • 165
0

Even the LeftClick+RightClick can be used to paste the selected text anywhere in Ubuntu. Though, the "Copy" by simple selection is possible in the terminal only, the LeftClick+RightClick "Paste" works just fine everywhere in the OS, eg:text-editors.

This makes it useful while working with touch-pads on laptop when a mouse is not around.

So in the end the gnome terminal works almost like putty, just with the exception of a simultaneous Left+Right Click for "Paste" rather than a Right Click.

0

Can't help with setting it up like Putty, but an easier mouse way than Ctrl+Shift+C, Ctrl+Shift+V or menu is select Alt+Middle-button = copy and Middle-button = paste

snoop
  • 4,040
  • 9
  • 40
  • 58
mvario
  • 742
0

I had the same issues using Ubuntu 14.10 and earlier: Unix style copy paste in the terminal not working. Disappointing default settings. However, here is a solution (partly resembling a wrap up of my predecessors):

  1. To fix the terminal issue I successfully put the following lines into my xorg.conf: (see if /etc/X11/xorg.conf is suitable for you. May be different for Lubuntu etc.)

    Section "InputClass"
        Identifier "middle button emulation class"
        MatchIsPointer "on"
        Option "Emulate3Buttons" "on"
    EndSection
    
  2. The very annoying malfunction of a missing 3rd mouse button (touch pad, Marble Mouse) can actually be fixed with the "gpointing-device-settings". Just install using CLI with

    sudo apt-get install gpointing-device-settings
    

    Then invoke

    gpointing-device-settings 
    

    to get the GUI window.

However, now I can use the unixish copy paste with mark and middle mouse button. At least in terminal.

And for the Marble Mouse Trackball there is a separate article with a lot of config details.

Hope it helps.

PS: Do not miss this Ask Ubuntu answer

on:

Enable middle mouse for all users by changing the default value in /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.peripherals.gschema.xml

or just look for the term in duckduckgo.

FF!!

addendum: Here is a rare and interesting text about how resolution of mice is handled:

Building a DPI Database for Mice

Aother excellent wrap up for the Marble Mouse / Logitech Marble Mouse Trackball is found here on the Ubuntu help wiki

Zanna
  • 70,465