Function: clipetty--emit

clipetty--emit is a natively compiled function defined in clipetty.el.

Signature

(clipetty--emit STRING)

Documentation

Emit STRING, optionally wrapped in a DCS, to an appropriate tty.

Source Code

;; Defined in /nix/store/7jgingzby054id3d9x64ir7i7a509mkl-emacs-packages-deps/share/emacs/site-lisp/elpa/clipetty-20200327.2241/clipetty.el
(defun clipetty--emit (string)
  "Emit STRING, optionally wrapped in a DCS, to an appropriate tty."
  (let ((tmux    (getenv "TMUX" (selected-frame)))
        (term    (getenv "TERM" (selected-frame)))
        (ssh-tty (getenv "SSH_TTY" (selected-frame))))
    (if (<= (length string) clipetty--max-cut)
        (write-region
         (clipetty--dcs-wrap string tmux term ssh-tty)
         nil
         (clipetty--tty ssh-tty tmux)
         t
         0)
      (message "Selection too long to send to terminal %d" (length string))
      (sit-for 1))))