* emacs の shell mode で su した時のパスワード [#v3f3a0af]

メッセージ

emacs の shell mode で su した際、パスワードが隠れずに表示されてしまう。多分、~/.emacs.d/site-start.d/behavior.el の

;;; shell-mode でパスワード入力を隠す

(add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt) (setq comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\|\\[sudo\\] \\)パスワード\\|[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'")

あたりを調整すれば何とかなりそうな気がする。


diff -u /etc/template/Default/.emacs.d/site-start.d/behavior.el  ~/.emacs.d/site-start.d/behavior.el
--- /etc/template/Default/.emacs.d/site-start.d/behavior.el	2018-05-11 14:57:28.000000000 +0900
+++ /home/kojima/.emacs.d/site-start.d/behavior.el	2018-07-21 11:14:46.492344929 +0900
@@ -34,7 +34,7 @@

 ;;; shell-mode でパスワード入力を隠す
 (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt)
-(setq comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\|\\[sudo\\] \\)パスワード\\|[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'")
+(setq comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\|\\[sudo\\] \\)\* のパスワード\\|パスワード\\|[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'")

;;; URL の扱い
(setq browse-url-browser-function 'browse-url-generic

「のパスワード」を追加した程度(w -- kojima 2018-07-21 (土) 23:05:40



トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2021-12-17 (金) 16:35:44