The following problem has happened repeatedly, since late emacs 27 and through emacs 28.1. It happens on this machine and on another machine running an older Mac OS (10.14). When I start up Emacs, things are fine for some time, usually *weeks*. But then slowly the problem begins and progressively worsens: commands that are designed to take you to the minibuffer for input (including switch-buffer, eval-expression, describe-function, ...) initiate the minibuffer and *immediately* shift the focus to another window (the top-left-most, curiously) in the frame. So I start entering the text and end up typing in a random buffer. As the problem worsens, it becomes intolerable, and I have to restart emacs, which I don't like to do. When this has happened, I have turned off various services like ivy, without effect. It seems to happen in low level functions like `(read-from-minibuffer "foo: ")`. The problem continues. Two other things to note. First, once it starts, it begins to happen *almost* all the time, but stops temporarily for a few minutes from time to time. I presume this is in response to some action I have taken, but I do not know what the common feature of that action is. When the problem halts, it tends to reassert itself quite quickly. Second, when it jumps me out of the minibuffer, the minibuffer window and command stay active. I have to explicitly move back into the minibuffer to keyboard-quit or to do the command. Curiously, however, when I switch focus into the minibuffer I have to hit return an extra time before the original command (e.g., switching buffers) takes effect. It's almost as if it's implicitly in some recursive layer that needs to exit. Similarly, I usually have to hit ^G *twice* before it quits. I've been puzzling over this for a while getting hints here and there but it seems to be low-enough level that I cannot catch the transition. (It's happening when calling functions in C-source code.) I cannot work for weeks in -Q, so I can't really reproduce it independent of my setup, but there have not been any really notable changes to my config that I am aware of since this became a problem. (It is possible, of course.) Thanks, Chris In GNU Emacs 28.1 (build 2, x86_64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.5 (Build 21G72)) of 2022-08-15 built on Christophers-MacBook-Pro.local Windowing system distributor 'Apple', version 10.3.2113 System Description: macOS 12.6.1 Configured using: 'configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-head@28/28.1_1/share/info/emacs --prefix=/usr/local/Cellar/emacs-head@28/28.1_1 --without-x --without-dbus --with-native-compilation --with-imagemagick --with-modules --with-gnutls --with-rsvg --with-xml2 --with-xwidgets --with-ns --disable-ns-self-contained 'LDFLAGS=-L/usr/local/lib/gcc/12 -I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include -I/usr/local/opt/gmp/include -I/usr/local/opt/jpeg/include'' Configured features: ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM XWIDGETS ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Shell Minor modes in effect: semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode) S))) dap-tooltip-mode: t dap-ui-many-windows-mode: t dap-ui-controls-mode: t dap-ui-mode: t dap-auto-configure-mode: t dap-mode: t treemacs-filewatch-mode: t treemacs-follow-mode: t treemacs-git-mode: t treemacs-fringe-indicator-mode: t csv-field-index-mode: t TeX-PDF-mode: t recentf-mode: t beacon-mode: t cua-mode: t display-time-mode: t global-edit-server-edit-mode: t pyvenv-mode: t counsel-projectile-mode: t projectile-mode: t pdf-occur-global-minor-mode: t which-key-mode: t windmove-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t async-bytecomp-package-mode: t all-the-icons-ivy-rich-mode: t ivy-rich-mode: t override-global-mode: t global-eldoc-mode: t show-paren-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /Users/genovese/.emacs.d/elpa/lispy-20220912.529/elpa hides /Users/genovese/.emacs.d/elpa/ivy-20220915.1532/elpa /Users/genovese/.emacs.d/elpa/transient-20220915.1511/transient hides /usr/local/Cellar/emacs-head@28/28.1_1/share/emacs/28.1/lisp/transient Features: (shadow emacsbug sendmail slime-tests ert cus-start novice macrostep-c cmacexp macrostep perl-mode vc-filewise plain-tex expand-region subword-mode-expansions text-mode-expansions cc-mode-expansions the-org-mode-expansions python-el-fgallina-expansions latex-mode-expansions js2-mode-expansions js-mode-expansions html-mode-expansions clojure-mode-expansions er-basic-expansions expand-region-core expand-region-custom misc artist picture reporter lsp-diagnostics lsp-modeline dap-mouse dap-ui gdb-mi gud bui bui-list bui-info bui-entry bui-core bui-history bui-button bui-utils lsp-lens dap-mode dap-tasks dap-launch posframe dap-overlays lsp-headerline lsp-icons lsp-ui lsp-ui-flycheck lsp-ui-doc xwidget lsp-ui-imenu lsp-ui-peek lsp-ui-sideline lsp-ui-util haskell-doc inf-haskell haskell-decl-scan haskell haskell-completions haskell-load haskell-commands highlight-uses-mode haskell-modules haskell-sandbox haskell-navigate-imports haskell-repl haskell-svg haskell-collapse haskell-debug haskell-interactive-mode haskell-presentation-mode haskell-compile haskell-hoogle haskell-process haskell-session haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support dabbrev haskell-customize ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util cal-move clj-refactor inflections cider cider-debug cider-browse-ns cider-mode cider-find cider-inspector cider-completion cider-profile cider-eval cider-jar cider-repl-history cider-repl cider-resolve cider-test cider-overlays cider-stacktrace cider-doc cider-browse-spec cider-clojuredocs cider-eldoc cider-client cider-common cider-connection cider-util cider-popup sesman-browser nrepl-client queue nrepl-dict parseedn parseclj-parser parseclj-lex parseclj-alist lsp-zig lsp-steep lsp-svelte lsp-sqls lsp-ruby-syntax-tree lsp-yaml lsp-xml lsp-vimscript lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet lsp-solargraph lsp-rust lsp-rf lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh lsp-php lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-magik lsp-nix lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown lsp-lua lsp-kotlin lsp-json lsp-javascript lsp-idris lsp-haxe lsp-haskell lsp-groovy lsp-hack lsp-graphql lsp-gleam lsp-go lsp-completion lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir lsp-elm lsp-dockerfile lsp-docker yaml lsp-dhall lsp-d lsp-css lsp-csharp gnutls lsp-crystal lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd lsp-beancount lsp-bash lsp-ansible lsp-angular lsp-ada lsp-actionscript lsp-ivy lsp-treemacs lsp-treemacs-themes treemacs treemacs-header-line treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-interface treemacs-extensions treemacs-mouse-interface treemacs-tags treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode treemacs-rendering treemacs-annotations treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals treemacs-fringe-indicator treemacs-scope treemacs-faces treemacs-icons treemacs-themes treemacs-core-utils pfuture hl-line treemacs-logging treemacs-customization treemacs-macros lsp-mode lsp-protocol spinner network-stream nsm inline ewoc cap-words superword subword mail-extr debug backtrace pulse markdown-mode ess-sp6-d sh-script smie executable jedi-core python-environment epc ctable concurrent deferred cl-print goto-addr csv-mode conf-mode wdired pdf-sync pdf-annot pdf-outline pdf-links pdf-history vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs bug-reference helm-ls-git helm-files image-dired helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp helm-utils helm-help helm-types magit-extras sort ox-hugo ox-hugo-deprecated org-id ox-blackfriday tomelr image-file image-converter flycheck cursor-sensor ess-smart-equals skeleton ess-r-mode ess-r-flymake ess-r-xref ess-trns ess-r-package ess-r-completion ess-roxy ess-r-syntax ess-rd ess-s-lang ess-help ess-mode ess-inf ess-tracebug ess ess-utils ess-custom sql-indent sql calc-arith calc-math calccomp calc-misc calc-alg calc-menu calc-aent misearch multi-isearch pcmpl-args pcmpl-linux tabify reftex-auc face-remap flyspell ispell preview font-latex latex latex-flymake tex-ispell tex-style tex texmathp tex-mode latexenc pcmpl-unix recentf tree-widget rjsx-mode js2-mode js sgml-mode facemenu string-inflection beacon origami origami-parsers org-lecture ox-org ox-texinfo ox-md ox-icalendar org-agenda org-refile ox-html table ox-beamer ox-latex ox-ascii ox-publish ox vc-git ob-sql ob-ditaa ob-calc calc-store calc-trail calc-ext calc calc-loaddefs calc-macs ob-ocaml ob-js ob-java ob-dot ob-sass ob-css ob-org ob-ruby ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-haskell ob-lisp ob-latex ob-clojure ob-python ob-R org-element avl-tree ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader ol-docview doc-view ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi ffap zenburn+-theme zsh-shell-plus zsh-shell-tracker zsh-shell-sync spaceline-config spaceline-segments spaceline powerline powerline-separators powerline-themes company-oddmuse company-keywords company-etags company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-cmake company-semantic company-template company-bbdb cua-rect cua-base time view edit-server-htmlize html2text edit-server reftex reftex-loaddefs reftex-vars auctex slime arc-mode archive-mode hyperspec highlight-indentation flymake-proc flymake company-capf help-fns radix-tree elpy elpy-rpc elpy-shell elpy-profile elpy-django elpy-refactor python tramp-sh tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time ls-lisp hideshow files-x etags fileloop generator pyvenv sesman vc vc-dispatcher clojure-mode align paredit counsel-projectile projectile quickrun em-banner eshell esh-mode esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util pdf-occur ibuf-ext ibuffer ibuffer-loaddefs tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch let-alist pdf-misc pdf-tools cus-edit cus-load wid-edit pdf-view magit-bookmark bookmark pp jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif dired-ranger dired-subtree dired-open dired-filter dired-hacks-utils dired-x dired-aux ripgrep grep ag vc-svn find-dired ack smart-mode-line rich-minority which-key fill-column-indicator multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-edit-lines mc-hide-unmatched-lines-mode mc-mark-more thingatpt mc-cycle-cursors multiple-cursors-core rect win-switch windmove magit-submodule magit-obsolete magit-popup 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 diff-mode git-commit log-edit message rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell server magit-mode transient comp comp-cstr warnings magit-git magit-base magit-section crm compat-27 compat-26 compat compat-macs clojure-snippets yasnippet smex ido helm helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source helm-multi-match helm-lib async all-the-icons-ivy-rich ivy-rich all-the-icons-ivy ivy-prescient prescient char-fold ivy-hydra counsel xdg xref project dired dired-loaddefs compile swiper ivy flx ivy-faces ivy-overlay colir color all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons company org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex iso8601 time-date ol org-keys oc org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs delsel pallet cask cask-bootstrap ansi package-build package-build-badges package-recipe lisp-mnt mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr pcase shut-up epl git commander finder-inf diminish hydra ring lv dash-functional ht f f-shortdoc shortdoc text-property-search s dash cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core tex-site edmacro kmacro cl advice easy-mmode slime-autoloads rx info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 cl-generic 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 simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 3566641 612519) (symbols 48 103685 847) (strings 32 501751 48344) (string-bytes 1 86210564) (vectors 16 220961) (vector-slots 8 4760102 551167) (floats 8 102412 3233) (intervals 56 257931 46427) (buffers 992 332))