Function: kkp--set-encoding-flags

kkp--set-encoding-flags is a natively compiled function defined in kkp.el.

Signature

(kkp--set-encoding-flags TERMINAL FLAGS)

Documentation

Set the active KKP flags in TERMINAL to FLAGS with the set command.

The set command is CSI = flags ; 1 u. Unlike the push/pop stack commands, it replaces the flags on the current stack entry in place. This works uniformly on terminals that implement the flag stack (kitty, ghostty, ...) and those that do not (e.g. zellij, which treats a stack pop as a plain disable): both directions are just an explicit flag value. FLAGS of 0 restores the legacy single-byte encoding of control keys.

Source Code

;; Defined in /nix/store/0igl9q4k4n87vg4h2gnnrlha21kx9biv-emacs-packages-deps/share/emacs/site-lisp/elpa/kkp-20260706.858/kkp.el
(defun kkp--set-encoding-flags (terminal flags)
  "Set the active KKP flags in TERMINAL to FLAGS with the set command.
The set command is CSI = flags ; 1 u.  Unlike the push/pop stack commands,
it replaces the flags on the current stack entry in place.  This works
uniformly on terminals that implement the flag stack (kitty, ghostty, ...)
and those that do not (e.g. zellij, which treats a stack pop as a plain
disable): both directions are just an explicit flag value.  FLAGS of 0
restores the legacy single-byte encoding of control keys."
  (when (terminal-live-p terminal)
    (send-string-to-terminal (kkp--csi-escape (format "=%s;1u" flags)) terminal)
    (kkp--flush-standard-output)))