Subject: bug#78310: 30.1; icomplete-mode interferes with epg's loopback pinentry mode when using encypted authinfo

From: "Oliver J. Mead" <[email-masked]>
Date: Wed, 07 May 2025 23:15:56 +0100

~/.authinfo.gpg exists, and corresponding keys exist with gnupg to
decrypt it, the relevant private key does have a password.

start emacs with 'emacs -Q', execute:
```
(set 'epg-pinentry-mode 'loopback)
(icomplete-mode 1)
```
Type 'C-x C-f /ssh:'.
In the minibuffer appears the prompt 'Password for [GPG KEY]: '.

At this point the expected behaviour is for this epg prompt to accept
the user's password input, decrypt the authinfo file and carry on with
the TRAMP path entry.

Attempting to input the password results in:
- Each character entered switches the minibuffer between displaying the
  epg prompt and displaying the 'find-file' prompt.
- Each character entered when the 'find-file' prompt is visible is added
  to that prompt's input.
- No characters appear to be added to the epg prompt - no '*'s appear
  before the cursor.
For example, if the user types '1234567890abcdefg' then the 'find-file'
prompt will be displayed, with the text '~//ssh:24680bdf'
entered. That's every other character of a password in plain text on the
screen and nothing useful going on. 

I have found a work-around for this issue:
Type any character into the epg prompt when it appears (this character
will neither end up in the epg prompt nor the 'find-file' prompt), then TAB when
the 'find-file' prompt returns. The epg prompt reappears and the
password can be typed as normal from this point. 

In GNU Emacs 30.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.4, Xaw3d scroll bars)
Repository revision: 7e1ec134828a479c748d725f9cc528c08d4bb710
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Arch Linux

Configured using:
 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
 --with-tree-sitter --localstatedir=/var --disable-build-details
 --with-modules --with-x-toolkit=lucid --without-gconf
 --without-gsettings '--program-transform-name=s/^ctags$/ctags.emacs/'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG LCMS2
LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: en_GB-UTF.8
  locale-coding-system: utf-8-unix

Major mode: Circe Channel

Minor modes in effect:
  fido-vertical-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  fido-mode: t
  global-emojify-mode: t
  emojify-mode: t
  doom-modeline-mode: t
  pdf-occur-global-minor-mode: t
  pyvenv-mode: t
  sly-symbol-completion-mode: t
  tracking-mode: t
  which-key-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  server-mode: t
  cursor-intangible-mode: t
  global-devil-mode: t
  devil-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  global-company-mode: t
  company-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  override-global-mode: t
  recentf-mode: t
  global-display-line-numbers-mode: t
  display-time-mode: t
  global-auto-revert-mode: t
  save-place-mode: t
  savehist-mode: t
  repeat-mode: t
  windmove-mode: t
  display-battery-mode: t
  minibuffer-depth-indicate-mode: t
  winner-mode: t
  xterm-mouse-mode: t
  auto-insert-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/olivermead/.emacs.d/elpa/which-key-20240620.2145/which-key hides /usr/share/emacs/30.1/lisp/which-key
/home/olivermead/.emacs.d/elpa/transient-20250501.846/transient hides /usr/share/emacs/30.1/lisp/transient
/home/olivermead/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /usr/share/emacs/30.1/lisp/bind-key
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package hides /usr/share/emacs/30.1/lisp/use-package/use-package
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /usr/share/emacs/30.1/lisp/use-package/use-package-lint
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /usr/share/emacs/30.1/lisp/use-package/use-package-jump
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /usr/share/emacs/30.1/lisp/use-package/use-package-ensure
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /usr/share/emacs/30.1/lisp/use-package/use-package-diminish
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /usr/share/emacs/30.1/lisp/use-package/use-package-delight
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /usr/share/emacs/30.1/lisp/use-package/use-package-core
/home/olivermead/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /usr/share/emacs/30.1/lisp/use-package/use-package-bind-key
/home/olivermead/.emacs.d/elpa/eglot-20221020.1010/eglot hides /usr/share/emacs/30.1/lisp/progmodes/eglot
/home/olivermead/.emacs.d/elpa/track-changes-1.4/track-changes hides /usr/share/emacs/30.1/lisp/emacs-lisp/track-changes

Features:
(vc-hg vc-git vc-bzr vc-dispatcher conf-mode rfc2104 tramp-cmds ido
cl-print tramp-cache time-stamp tramp-sh shortdoc shadow sort
mixed-pitch mail-extr cus-start icomplete mule-util emacsbug
circe-notifications alert log4e gntp epa-file lui-track-bar lui-track
pulse paredit rainbow-delimiters company-oddmuse company-keywords
company-etags company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-bbdb emojify tar-mode notifications doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path
nerd-icons nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon
nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon
nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon
nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon pdf-occur ibuf-ext
ibuffer ibuffer-loaddefs tablist advice tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent pdf-isearch
let-alist pdf-misc pdf-loader pdf-tools pdf-view jka-compr pdf-cache
pdf-info pdf-util pdf-macs image-mode exif ox-pandoc ox-org ox-extra
ox-odt rng-loc rng-uri rng-parse rng-match rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-html table
ox-ascii ox-publish ox org-attach org-element org-persist org-id
org-refile org-element-ast avl-tree org-contrib doom-themes-ext-org
doom-themes-ext-treemacs doom-themes-ext-neotree
doom-themes-ext-visual-bell doom-gruvbox-light-theme doom-themes
doom-themes-base zig-mode reformatter company-jedi jedi-core
python-environment epc ctable concurrent deferred pyvenv company-irony
company-template irony-completion irony-snippet irony irony-iotask
geiser-guile info-look geiser-debug geiser-repl geiser-image geiser-capf
geiser-doc geiser-menu geiser-autodoc geiser-edit geiser-completion
geiser-eval geiser-connection geiser-syntax scheme geiser-impl help-fns
radix-tree geiser-log geiser-popup view geiser-custom geiser-base
racket-mode racket-input quail racket-bug-report cus-edit cus-load
racket-lisp-mode racket-collection tq racket-repl-buffer-name
racket-stepper racket-shell racket-logger racket-profile racket-package
racket-smart-open racket-xp racket-xp-complete racket-imenu racket-edit
hideshow racket-repl semantic/symref/grep grep semantic/symref
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet racket-show racket-eldoc
racket-scribble-anchor racket-describe racket-scribble racket-visit shr
pixel-fill kinsoku url-file svg dom racket-complete racket-common
racket-parens racket-indent racket-font-lock racket-ppss
racket-keywords-and-builtins racket-doc racket-browse-url racket-cmd
racket-back-end racket-util racket-custom geiser sly sly-completion
sly-buttons sly-messages sly-common apropos etags fileloop arc-mode
archive-mode hyperspec lsp-mode lsp-protocol xref spinner network-stream
markdown-mode lv inline ht ewoc bnf-mode format-all language-id
inheritenv circe-color-nicks circe lui-irc-colors irc gnutls lcs
lui-logging lui-format lui tracking shorten flyspell ispell circe-compat
ivy-pass ivy ivy-faces colir password-store-otp pass f dash s
password-store auth-source-pass which-key magit-bookmark magit-submodule
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode
diff-mode track-changes git-commit log-edit message sendmail yank-media
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util
mailabbrev gmm-utils pcvs-util add-log magit-core magit-autorevert
magit-margin magit-transient magit-process with-editor server magit-mode
transient benchmark magit-git magit-base magit-section cursor-sensor crm
llama compat debbugs soap-client mm-decode mm-bodies mm-encode url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm puny rng-xsd rng-dt rng-util xsd-regexp
debbugs-compat devil edmacro kmacro undo-tree diff queue zone-tmux-clock
zone vterm-tmux multi-vterm vterm bookmark face-remap compile
text-property-search color term disp-table ehelp vterm-module term/xterm
xterm flycheck company yasnippet-snippets yasnippet exec-path-from-shell
simple-httpd pp webpaste request mailheader mail-utils use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
project dired-x dired dired-loaddefs tramp trampver tramp-integration
tramp-message tramp-compat xdg shell parse-time iso8601 tramp-loaddefs
recentf tree-widget wid-edit display-line-numbers time autorevert
filenotify saveplace savehist repeat windmove battery dbus xml mb-depth
winner comp comp-cstr cl-extra help-mode warnings comp-run comp-common
xt-mouse autoinsert eshell esh-cmd generator esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-module-loaddefs esh-util files-x
emacs-lock org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src sh-script smie treesit executable ob-comint org-pcomplete
pcomplete comint ansi-osc ansi-color ring org-list org-footnote
org-faces org-entities time-date noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold
org-fold-core org-keys oc org-loaddefs thingatpt find-func cal-menu
calendar cal-loaddefs org-compat org-macs format-spec
all-the-icons-autoloads bnf-mode-autoloads circe-autoloads
company-autoloads counsel-autoloads debbugs-autoloads
desktop-environment-autoloads devil-autoloads doom-modeline-autoloads
doom-themes-autoloads emmet-mode-autoloads emms-autoloads
evil-collection-autoloads annalist-autoloads evil-commentary-autoloads
evil-snipe-autoloads evil-surround-autoloads
exec-path-from-shell-autoloads exwm-autoloads flycheck-autoloads
format-all-autoloads geiser-guile-autoloads geiser-autoloads
general-autoloads haskell-mode-autoloads helm-autoloads
helm-core-autoloads inheritenv-autoloads irony-autoloads
ivy-rich-autoloads language-id-autoloads log4e-autoloads
lsp-mode-autoloads mixed-pitch-autoloads nerd-icons-autoloads
nov-autoloads esxml-autoloads org-contrib-autoloads
org-download-autoloads async-autoloads ox-pandoc-autoloads
paredit-autoloads parinfer-rust-mode-autoloads pass-autoloads
password-store-autoloads pdf-tools-autoloads python-mode-autoloads
pyvenv-autoloads racket-mode-autoloads rustic-autoloads
markdown-mode-autoloads rust-mode-autoloads scribble-mode-autoloads
f-autoloads simple-httpd-autoloads sly-autoloads swiper-autoloads
ivy-autoloads tablist-autoloads track-changes-autoloads
treemacs-evil-autoloads evil-autoloads goto-chg-autoloads
treemacs-icons-dired-autoloads treemacs-magit-autoloads magit-autoloads
pcase transient-autoloads magit-section-autoloads llama-autoloads
treemacs-persp-autoloads persp-mode-autoloads treemacs-tab-bar-autoloads
treemacs-autoloads posframe-autoloads ht-autoloads hydra-autoloads
avy-autoloads dash-autoloads use-package-autoloads bind-key-autoloads
vterm-autoloads webpaste-autoloads request-autoloads wfnames-autoloads
which-key-autoloads info with-editor-autoloads xelb-autoloads
yasnippet-snippets-autoloads yasnippet-autoloads zig-mode-autoloads
reformatter-autoloads zone-tmux-clock-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting font-render-setting cairo
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
native-compile emacs)

Memory information:
((conses 16 970916 766872) (symbols 48 65794 9) (strings 32 358977 23501)
 (string-bytes 1 8622213) (vectors 16 122931) (vector-slots 8 1501202 395754)
 (floats 8 1145 19408) (intervals 56 6796 3416) (buffers 992 27))