![`$ pass insert [..]` を使用するとターミナルがハングする](https://rvso.com/image/1618496/%60%24%20pass%20insert%20%5B..%5D%60%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%81%8C%E3%83%8F%E3%83%B3%E3%82%B0%E3%81%99%E3%82%8B.png)
この投稿はユーティリティに関するものですpass
。私が使用しようとしたときを除いて、それは私にとってうまく機能します
$ pass insert Email/gmail/myname
私の端末にはプロンプトが表示される
Enter password for Email/gmail/myname: _
そしてハングします。今のところ、Ctrl-C
プログラムを停止する以外のキー操作は影響しません。興味深いことに、プログラムはディレクトリを作成しました~/.local/share/password-store/Email/gmail/
。以前に同じ問題を抱えていた人はいますか?
(私はpass
Archでv1.7.3を使用しています。)
答え1
対話型挿入の場合、enter
キーはパスワードの入力が完了したことを示します。
$ pass insert test
Enter password for test: [keystrokes: asdf<enter>]
Retype password for test: [keystrokes: asdf<enter>]
$ pass test
adsf
さらに、--echo
または を使用すると-e
、パイプから stdin を介して入力を取得できます。
たとえば、testo
パスワード付きのエントリを作成しますhello world
:
$ echo "hello world" | pass insert --echo testo
[main b451b23] Add given password for testo to store.
1 file changed, 1 insertion(+)
create mode 100644 testo.gpg
$ pass testo
hello world
ただし、これは単一行に対してのみ機能します。複数行入力の場合は、--multiline
の代わりに フラグを使用します--echo
。
$ man pass
$ echo "password123" > passfile.txt
$ echo "Email: [email protected]" >> passfile.txt
$ cat passfile.txt | pass insert --multiline test
Enter contents of test and press Ctrl+D when finished:
[main e1acd8e] Add given password for test to store.
1 file changed, 1 insertion(+)
create mode 100644 test.gpg
$ pass test
password123
Email: [email protected]
マニュアルページのドキュメントには、enter
入力を終了するために押すことについては触れられていないので、開発者メーリングリストそれについて。これが現在の状況ですman pass
:
insert [ --echo, -e | --multiline, -m ] [ --force, -f ] pass-name
Insert a new password into the password store called pass-name. This will read the new password from standard in. If --echo or -e is not
specified, disable keyboard echo when the password is entered and confirm the password by asking for it twice. If --multiline or -m is spec‐
ified, lines will be read until EOF or Ctrl+D is reached. Otherwise, only a single line from standard in is read. Prompt before overwriting
an existing password, unless --force or -f is specified. This command is alternatively named add.