Function: kkp-focus-change

kkp-focus-change is a natively compiled function defined in kkp.el.

Signature

(kkp-focus-change &rest _)

Documentation

Enable KKP when focus on terminal which has not yet enabled it once.

Source Code

;; Defined in /nix/store/0igl9q4k4n87vg4h2gnnrlha21kx9biv-emacs-packages-deps/share/emacs/site-lisp/elpa/kkp-20260706.858/kkp.el
(defun kkp-focus-change (&rest _)
  "Enable KKP when focus on terminal which has not yet enabled it once."
  (let* ((frame (selected-frame))
         (terminal (kkp--selected-terminal))
         (state (kkp--terminal-state terminal)))
    (when
        (and (terminal-live-p terminal)
             (not (display-graphic-p terminal))
             (not (and state (kkp--state-setup-visited state)))
             (frame-focus-state frame))
      (kkp--verbose "focus changed to terminal; enabling KKP")
      (kkp-enable-in-terminal terminal))))