Pass -c fails to copy to clipboard

It started recently after one of latest manjaro updates, pass -c does not copy the password to the clipboard.

I am using manjaro gnome, x11.

I noticed the optional xclip and wl-clipboard were installed.
Then I tried removing wl-clipboard but did not work.
Reinstalled wl-clipboard and removed xclip and testes, but did not work.

I cannot find in internet any reference to similar issue.

Have you had similar issue? Any advice for a solution?

thanks in advance!

Because you say you are using x11 - I have to say that wl-clipboard is for wayland - not x11.

There is no command named pass - is that a script you created ?

If you have the password in a file you can use wl-copy (on wayland)

wl-copy -n < <your-file.txt>

Using x11 using xclip

xclip -sel clip <your-file.txt>

pass is in the Extra repo:

pamac info pass
pamac info pass
Name                  : pass
Version               : 1.7.4-7
Description           : Stores, retrieves, generates, and synchronizes passwords securely
URL                   : https://www.passwordstore.org/
Licenses              : GPL2
Repository            : extra
Installed Size        : 47.7 kB
Groups                : --
Depends On            : bash gnupg tree
Optional Dependencies : git: for Git support [Installed]
                        dmenu: for passmenu
                        xdotool: to type passwords with passmenu
                        ydotool: to type passwords with passmenu (wayland) [Installed]
                        qrencode: for QR code support [Installed]
                        vim-plugin-runtime: for redact_pass.vim
                        xclip: for clipboard support on X11
                        wl-clipboard: for clipboard support on Wayland [Installed]
                        pinentry [Installed]
                        gtk3: pinentry backend (gtk3) [Installed]
                        gcr: pinentry backend (gnome3) [Installed]
                        qt5-x11extras: pinentry backend (qt) [Installed]
                        kwayland5: pinentry backend (qt) [Installed]
Provides              : passmenu
Replaces              : passmenu
Conflicts With        : passmenu
Packager              : Brett Cornwall <ainola@archlinux.org>
Build Date            : Mon 27 Jan 2025 12:49:02
Validated By          : MD5 Sum  SHA-256 Sum  Signature
2 Likes

What I refer to is the default system - there is no command named pass.

I cannot possibly guess if the quoted command exist somewhere in the universe.

1 Like

Sure, that is why I tried first removing wl-clipboard.
Later, also tried re-installing pass and xclip with no success.
wl-clipboard stays unistalled at the moment as no other package requires it.

$ pass -c
bash: pass: command not found

https://linux.die.net/man/1/pass

Name

pass - stores, retrieves, generates, and synchronizes passwords securely

Synopsis

pass [ COMMAND ] [ OPTIONS ]… [ ARGS ]…

Description

The pass utility provides a series of commands for manipulating the password store, allowing the user to add, remove, edit, synchronize, generate, and manipulate passwords.

If no COMMAND is specified, COMMAND defaults to either show or ls, depending on the type of specifier in ARGS. Otherwise COMMAND must be one of the valid commands listed below.

Commands

show [ –clip, -c ] pass-name
Decrypt and print a password named pass-name. If –clip or -c is specified, do not print the password but instead copy the first line to the clipboard using xclip and then restore the clipboard after 45 seconds.

generate [ –no-symbols, -n ] [ –clip, -c ] [ –force, -f ] pass-name pass-length
Generate a new password using pwgen of length pass-length and insert into pass-name. If –no-symbols or -n is specified, do not use any non-alphanumeric characters in the generated password. If –clip or -c is specified, do not print the password but instead copy it to the clipboard using xclip and then restore the clipboard after 45 seconds. Prompt before overwriting an existing password, unless –force or -f is specified.

I tested your issue (Plasma X11 and Plasma Wayland) and cannot reproduce.

 $ pass generate test
<some-generated-pass>

 $ pass -c test

Pasting the clipboard gives the expected result

Thanks for you help.

It turns out that the issue was that I was using Zed editor to proof that the inserted new passwords were really correct. But Zed uses its own clipboard different from the system clipboard.

Then I tested with other editors, nano and vscode and browsers. nano behaves like Zed, it does not paste from pass -c. But vscode and browsers do.

So, it resolves to my poor understanding of clipboards in linux and how applications use them.

thanks again to all for your help!

3 Likes

Sounds strange - the system clipboard is the same where ever you go - how you get/set the contents will differ from CLI to GUI. With CLI you add Shift to the shortcut because e.g. Ctrlc has a different meaning inside a virtual terminal.

For verification - since you specifically mention Zed - I installed zed from the official repositories.

It behaves as expected on my test system.

As for a CLI editor - such as nano or micro - you will need to use the extended shortcut for pasting clipboard content ShiftCtrlv

These might be of interest, when you find some free time:

Regards

2 Likes

In my system, after pass -c get following behavior:

In terminal:
Ctrlv N/A
ShiftCtrlv paste the passw
ShiftIns does not paste the passw

In vscode:
Ctrlv paste the passw
ShiftCtrlv paste the passw
ShiftIns paste the passw

In Zed:
Ctrlv does not paste the passw
ShiftCtrlv does not paste the passw
ShiftIns does not paste the passw

I cannot say what your issue may be - I cannot reproduce it - what ever it is, it appears to be local to your system configuration.

A wild guess - application version?

 $ mbn info zed -q
Branch         : archlinux
Name           : zed
Version        : 0.188.5-1
Repository     : extra
Build Date     : Fri 30 May 2025 21:51:40 
Packager       : Caleb Maclennan <alerque@archlinux.org>

Branch         : unstable
Name           : zed
Version        : 0.188.4-1
Repository     : extra
Build Date     : Fri 30 May 2025 09:06:57 
Packager       : Caleb Maclennan <alerque@archlinux.org>

Branch         : testing
Name           : zed
Version        : 0.186.11-1
Repository     : extra
Build Date     : Tue 20 May 2025 07:53:06 
Packager       : Caleb Maclennan <alerque@archlinux.org>

Branch         : stable
Name           : zed
Version        : 0.186.9-1
Repository     : extra
Build Date     : Thu 15 May 2025 15:39:49 
Packager       : Caleb Maclennan <alerque@archlinux.org>

I synced Zed 0.188.4 from unstable repo.

I really don't like screenshots - in this comment I will use one

Zed and terminal (konsole app) side-by-side with timestamp

That may be the reason, I have Zed 0.186.9 from stable.

Good thing is I learned a more about clipboards in Linux and that I need to keep learning. Also I learned now a way to test that passw was correctly inserted in pass.

Thanks again for your help and have a nice weekend :slight_smile:

1 Like

I downloaded Zed 0.188.5 from the official website and installed it manually and can confirm that this version works as expected.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.