From hello at samhh.com Mon May 17 21:01:02 2021 From: hello at samhh.com (Sam A. Horvath-Hunt) Date: Mon, 17 May 2021 22:01:02 +0100 Subject: Broken fish completions Message-ID: Hey there! I recently set $PASSWORD_STORE_DIR, and in doing so my fish completions have broken. I think this is the most appropriate place to report this? Specifically what happens is as follows: $ pass show $ pass show path/to/password/store/dir/ Completion continues to work until I select something, at which point pass predictably fails because the filesystem path to the password store shouldn't be in there. If I tab after this, or only after having partially written the store path, I just get a bunch of fish completions all of which include the full path to the store. Any ideas? Cheers, Sam From aclopte at gmail.com Mon May 17 22:32:14 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Tue, 18 May 2021 00:32:14 +0200 Subject: PATCH: fish-completion: don't print full path when PASSWORD_STORE_DIR is set In-Reply-To: References: Message-ID: <20210517223214.kkpyhxyas5bico6y@gmail.com> >From 2a9a0a03e9c8d87b92a9f9d2cc93213c13fb3acd Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 18 May 2021 00:17:42 +0200 Subject: [PATCH] fish-completion: don't print full path when PASSWORD_STORE_DIR is set "__fish_pass_print" enumerates all files in the password store and strips the password store directory prefix from file paths using sed. If $PASSWORD_STORE_DIR had a trailing slash, sed would fail to remove the prefix. Sanitize PASSWORD_STORE_DIR by removing all trailing slashes. --- On Mon, May 17, 2021 at 10:01:02PM +0100, Sam A. Horvath-Hunt wrote: > Hey there! > > I recently set $PASSWORD_STORE_DIR, and in doing so my fish completions > have broken. I think this is the most appropriate place to report this? > Specifically what happens is as follows: > > $ pass show > $ pass show path/to/password/store/dir/ This patch will fix this. A workaround is to set $PASSWORD_STORE_DIR without a trailing slash. src/completion/pass.fish-completion | 1 + 1 file changed, 1 insertion(+) diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion index 3e70af1..eca62de 100644 --- a/src/completion/pass.fish-completion +++ b/src/completion/pass.fish-completion @@ -7,6 +7,7 @@ set -l PROG 'pass' function __fish_pass_get_prefix set -l prefix "$PASSWORD_STORE_DIR" + set prefix (string replace --regex -- '(^.+?)/*$' '$1' $prefix) if [ -z "$prefix" ] set prefix "$HOME/.password-store" end -- 2.31.1 From aclopte at gmail.com Tue May 18 20:59:13 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Tue, 18 May 2021 22:59:13 +0200 Subject: PATCH: fish-completion: don't print full path when PASSWORD_STORE_DIR is set In-Reply-To: <20210518204822.xjsslks4ekkbqlw3@gmail.com> References: <20210517223214.kkpyhxyas5bico6y@gmail.com> <20210518204822.xjsslks4ekkbqlw3@gmail.com> Message-ID: <20210518205913.mqyovy4tybyj2tjy@gmail.com> On Tue, May 18, 2021 at 08:37:42PM +0100, Sam A. Horvath-Hunt wrote: > Hey Johannes, > > > A workaround is to set $PASSWORD_STORE_DIR without a trailing slash. > > I've not tried the patch, but thanks for the workaround, that works > great! just in case anyone needs it, the patch can be test-run by copying src/completion/pass.fish-completion to ~/.config/fish/completions/pass.fish > > The only thing I'd note is that it's still broken if there's an > additional slash preceding it. In my case that's because I've defined a > path in a variable with a trailing slash and then for readability done > "$MYVAR/subpath", making it effectively "/home/user/path//subpath". I > don't know if this is relevant to the fix at all. Right, good catch - we can't expect a canonical path here. I'll send a more robust version. Cheers From aclopte at gmail.com Tue May 18 20:59:25 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Tue, 18 May 2021 22:59:25 +0200 Subject: [PATCH v2] fish-completion: don't print full path when PASSWORD_STORE_DIR is set In-Reply-To: References: <20210517223214.kkpyhxyas5bico6y@gmail.com> Message-ID: <20210518205925.oaqahjjtuciomkw7@gmail.com> "__fish_pass_print" enumerates all files in the password store and uses sed to strip their common prefix - the password store directory. If $PASSWORD_STORE_DIR had a trailing slash, sed would fail to remove the prefix. Fix this by canonicalizing $PASSWORD_STORE_DIR. --- src/completion/pass.fish-completion | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion index 3e70af1..38a4865 100644 --- a/src/completion/pass.fish-completion +++ b/src/completion/pass.fish-completion @@ -6,11 +6,11 @@ set -l PROG 'pass' function __fish_pass_get_prefix - set -l prefix "$PASSWORD_STORE_DIR" - if [ -z "$prefix" ] - set prefix "$HOME/.password-store" + if set -q PASSWORD_STORE_DIR + realpath -- "$PASSWORD_STORE_DIR" + else + echo "$HOME/.password-store" end - echo "$prefix" end function __fish_pass_needs_command -- 2.31.1 From Jason at zx2c4.com Tue May 18 21:03:31 2021 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Tue, 18 May 2021 23:03:31 +0200 Subject: [PATCH v2] fish-completion: don't print full path when PASSWORD_STORE_DIR is set In-Reply-To: <20210518205925.oaqahjjtuciomkw7@gmail.com> References: <20210517223214.kkpyhxyas5bico6y@gmail.com> <20210518205925.oaqahjjtuciomkw7@gmail.com> Message-ID: Applied. Thanks for the patch. Jason From Jason at zx2c4.com Mon May 31 07:49:40 2021 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Mon, 31 May 2021 09:49:40 +0200 Subject: IRC channels #wireguard, #cgit, and #pass open on Libera.Chat Message-ID: Hi, The IRC channels #wireguard, #cgit, and #pass will now be on Libera.Chat in official capacity. This means that you can now connect with other users and developers of these projects by pointing your IRC client at: Server: irc.libera.chat Port: 6697 with TLS (aka "ssl" or "secure port") Channel: #wireguard, #cgit, and #pass On Weechat: /server add libera irc.libera.chat/6697 -ssl -autoconnect -autojoin=#wireguard,#cgit,#pass /save /connect libera On irssi: /network add libera /channel add -auto #wireguard libera /channel add -auto #cgit libera /channel add -auto #pass libera /server add -network libera -auto -tls irc.libera.chat 6697 /save /connect libera Users who want to simply pop online ephemerally to ask a quick question can also use the web interface: . Though do note that the community generally appreciates it when people maintain a more continuous presence logged in ("idling"). For folks who want to connect to IRC longer term, but don't want to futz around with overly technical things, services like IRCCloud.com (paid) and Matrix.org (free) offer a way of staying connected to IRC networks from your web browser and mobile phone. With large swaths of the free software community recently departing our old home of freenode, the choice was between the new Libera.Chat IRC network, the venerable OFTC IRC network, and something newfangled like Slack, Discord, Mattermost, Rocket.Chat, Zulip, or `ncat -l -k --chat`. This choice was not easy. The primary advantage of the newer platforms is their broader accessibility to less technical users and expanded feature sets. Their disadvantage is that they are standalone/siloed tools, which don't promote cross-pollination between our community and other communities. In contrast, the primary advantage of IRC in general over the more recent communication tools is the community around IRC. Somebody hanging out over in #archlinux asking a question about WireGuard is easily referred to #wireguard for additional troubleshooting, and vice versa. And different types of users and developers frequently meet and share ideas. It is a commons of sorts. There are additional differences between the platforms (with keywords like "javascript" or "licensing" or "curmudgeonly"), but this distinction between being part of the larger community and free software ecosystem, and not, strikes me as a critical basis of decision. In deciding between Libera.Chat and OFTC, the decision was a bit harder, but ultimately was made with the same principle in mind. OFTC is old and stable, having apparently few governance issues over a long history. In contrast, Libera.Chat is brand new and was created by a group of volunteers that, while having an impressive history of running freenode successfully for many years, have just emerged from a highly publicized conflict. However, Libera.Chat hosts a significantly larger portion of the free software community than OFTC. Seeing that our motivation for remaining on IRC in the first place is community, going with the larger network makes most sense, even if it does not yet have a proven track record of stability. I hope that rationale makes sense. See you all in the new channels. Thanks, Jason PS: WireGuard community members, enthusiasts, contributors, and developers can now request a "wireguard/tunneler/{nick}" cloak from Mira (mira), Aaron (amdj), or me (zx2c4). Shoot one of us a message on IRC and we'll set it up.