Can't paste in gnome-terminal from Keepas2 running via mono

7

3

I'm running OpenSUSE 13.2 and I'm using Keepass2. The app is runnig via mono. I want to copy my password from keepass to the terminal, however this isn't working using CTRL + SHIFT + V. This is a common problem but I can't find a proper solution.

Note that I won't run Keepassx as Keepas (.net) has many more features (e.g. KeepassHTTP).

Thanks in advance!

LEDfan

Posted 2015-07-11T07:30:24.020

Reputation: 171

why do you run keepass2 under wine? - you can install and run it native (just with mono)! – DJCrashdummy – 2015-07-11T08:07:05.827

1Yeah, that's what I mean...... I just install it via my package manager.. – LEDfan – 2015-07-11T08:09:20.010

Answers

8

I found the solution!

I can confirm this works on OpenSUSE and Arch Linux. I hope this works on other distro's too. I tried everything in this question How can I merge the gnome clipboard and the X selection? but nothing helped. I found this bug at launchpad which worked: https://bugs.launchpad.net/ubuntu/+source/keepass2/+bug/1010289 .

Solution: Install both xdotool and xsel, and restart gnome-terminal and keepass2.

I tested this on gnome-terminal, terminator and konsole.

EDIT: this solution works, however not for some Java based applications. (PHPStorm and other Jetbrains software) I solved this: - install parcellite - start it - right click on the tray icon and choose preferences - make sure Use Copy (Ctrl+C), Use Primary and Synchronise clipboards are enabled.

enter image description here

EDIT2: There is a better solution for the Java problem (thanks @colan), a patch has been merged into xsel but this hasn't been released (see: https://github.com/kfish/xsel/pull/6), but compiling from source is very easy:

  1. first remove xsel using your package manager
  2. clone the repo: git clone https://github.com/kfish/xsel
  3. cd xsel
  4. touch README (looks like the autogen script needs a README file, but can't found it)
  5. ./autogen.sh
  6. make
  7. sudo make install

You can manually test it: echo "test" | xsel -i -b.

This will install xsel into /usr/loca/bin/. Note that version 1.2.0 of xsel is not the correct version, this was released 9 years ago and doesn't include the patch! On arch linux you can use xsel-git from the AUR https://aur.archlinux.org/packages/xsel-git/.

LEDfan

Posted 2015-07-11T07:30:24.020

Reputation: 171

xdotool was installed, but xsel did the trick for me, too! I can confirm that i had the same problem and that this solution solved it on Debian Testing. – amenthes – 2015-09-25T12:01:41.243

1

The Java issue is described at https://bugs.launchpad.net/ubuntu/+source/keepass2/+bug/1379877 .

– colan – 2017-03-08T16:21:29.097

2@colan wow that's awesome. Compiling xsel from source resolves the issue! – LEDfan – 2017-03-09T06:48:49.177

I did all your steps to compile xsel from source and I get this echo "test" | xsel -i -b. bash: /usr/bin/xsel: No such file or directory. I manually copied it from /usr/local/bin, but my version is still xsel version 1.2.0 by Conrad Parker <conrad@vergenet.net> – Freedo – 2018-01-13T07:44:08.857