2

I have a need for very simple terminal (no multiple tabs, no menu etc. - I use XMonad so splitting windows is not necessary as well). I tried to use xterm but unfortunately I need to be able to copy'n'paste while my middle mouse button does not work. I also tried to use st but it uses it's own termcap, which breaks many remote programs on any system it's not installed on.

(Any option to make xterm copy to clipboard on mark or st use TERM=xterm is also acceptable).

  • IIRC, you can use shift+insert to paste into xterm – evilsoup Dec 10 '13 at 10:52
  • @evilsoup I have troubles with copying from xterm - not pasting into it. – Maciej Piechotka Dec 10 '13 at 11:23
4

Xterm.

If you want to copy to the clipboard instead of to the primary selection, set the selectToClipboard resource to true. In your ~/.Xresources:

XTerm.vt100.selectToClipboard: true

If you have a mouse without a middle button, pressing both buttons at the same time emulates a middle click in most configurations.

You can use xsel or xclip to transfer between the selections:

xsel | xsel -b    # PRIMARY -> CLIPBOARD
xsel -b | xsel    # CLIPBOARD -> PRIMARY
0

Select to copy is much older than wheel mice, so back in the day we would simultaneously click both mouse buttons to paste. This behavior is configurable through the InputDevice section of your /etc/X11/xorg.conf file (or any file in the /etc/X11/xorg.conf.d directory):

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    ## Enable two-button pasting
    Option         "Emulate3Buttons" "yes"
EndSection

I haven't done this in years though and it turns out that there is now a conflict with Gnome that causes this approach to fail. If I understand correctly, it should still work for non-Gnome based environments.

If you are using Gnome or a Gnome derivative, use this command to activate two-button emulation of a middle click:

gsettings set org.gnome.settings-daemon.peripherals.mouse \
  middle-button-enabled true

You should now be able to middle click using both buttons and keep using your favorite terminal-emulator.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.