On 11/21/2015 01:10 AM, Michael Clemens wrote: > when using pass via ssh on a remote system, I cannot make use of the > clipboard feature. In order to output the password without actually > displaying it, I wrote the following patch which prints the password in > red on a red background while still being able to be manually copied to > the clipboard:
that's a very clever idea :-)
for more portability (and readability), use "tput setaf 1; tput setab 1"
and "tput sgr0" to revert to default colours.
(yes, I know there are more hardcoded escape sequences in pass, but...)
> if [[ $clip -eq 0 ]]; then
> - $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?
> + if [[ $hidden -eq 0 ]]; then
> + $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?
> + else
> + local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n
> 1)"
> + [[ -n $pass ]] || exit 1
> + echo -e "\e[0;31;41m$pass\e[0m"
> + fi
> else
> local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"
> [[ -n $pass ]] || exit 1
there is something strange with your tab-width, it looks like.
--
Kjetil T. Homme
Redpill Linpro - Changing the game
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Password-Store mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/password-store
