From tunaflish.ai at gmail.com Sun Mar 15 23:58:30 2026 From: tunaflish.ai at gmail.com (tuna) Date: Mon, 16 Mar 2026 00:58:30 +0100 Subject: [PATCH] Use native zsh functions to handle completion Message-ID: Hi all, I would like to suggest using the zsh's native _files function in the completion script. This eliminates the dependency on find, sed, and sort, although they are present on virtually every system. A more important advantage of using _files is the integration with the zsh completer, which enables the use cases like `pass p/c/f` -> `pass parent/child/file`, and `pass ` will only list one depth of directories instead of listing all files and their full paths. This is how completion works for `ls`, and, I think, should be an expected behavior. Here is a small example. Expected: ``` % path # dir1/ dir2/ ``` Reality: ``` % path # dir1/file1 dir1/file2 dir2/file3 dir2/file4 ``` Using _files solves it. It also handles all the special characters, so `sed` is not needed. Another completion logic, that I think should be handled by zsh built-ins instead of hard-coded functionality, is the git subcommand. A simple `local service=git; _git` will enable ALL git completions, instead of the subset given in the completion script. Best regards, tunaflsh --- a/src/completion/pass.zsh-completion +++ b/src/completion/pass.zsh-completion @@ -73,16 +73,8 @@ _pass_complete_entries_with_subdirs ;; git) - local -a subcommands - subcommands=( - "init:Initialize git repository" - "push:Push to remote repository" - "pull:Pull from remote repository" - "config:Show git config" - "log:Show git log" - "reflog:Show git reflog" - ) - _describe -t commands 'pass git' subcommands + local service=git + _git ;; show|*) _pass_cmd_show @@ -121,10 +113,12 @@ _pass_complete_entries } _pass_complete_entries_helper () { - local IFS=$'\n' + local -a ignored=(.git .gpg-id) local prefix zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""} + # Remove the default all-files fallback + zstyle ":completion:${curcontext}:*" file-patterns '%p:globbed-files' '*(-/):directories' + _files -W "$prefix" -g '**.gpg(:r)' -F ignored } _pass_complete_entries_with_subdirs () { From me at captnemo.in Tue Mar 24 18:05:46 2026 From: me at captnemo.in (Nemo) Date: Tue, 24 Mar 2026 19:05:46 +0100 Subject: [PATCH] Support wl-copy --sensitive flag Message-ID: Hi all, Attaching a patch to add support for --sensitive flag in wl-copy invocations. wl-clipboard landed a change recently in 2.3.0[0,1] that adds support for a --sensitive flag. It sets a hint (also shared by other password managers such as KeePassXC) that marks the clipboard as sensitive. Other tools (such as cliphist) can then decide to ignore contents. I've tested this against cliphist[2], which ignores all `pass -c` contents and they are not recorded in the cliphist history. The patch is straight-forward, and checks for `--sensitive` via a grep on the `--help` command. Other options (checking for --version, or calling it twice) seemed worse. Thanks, Nemo [0]: https://github.com/bugaevc/wl-clipboard/releases/tag/v2.3.0 [1]: https://github.com/bugaevc/wl-clipboard/commit/e3c1b21ddd0885fba909602cf21e9f4f35862dea [2]: https://github.com/sentriz/cliphist/issues/58#issuecomment-3732547957 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Support-wl-copy-s-sensitive-flag.patch Type: text/x-patch Size: 943 bytes Desc: not available URL: