Function: ghostel-tty-forward-notify

ghostel-tty-forward-notify is a natively compiled function defined in ghostel.el.

Signature

(ghostel-tty-forward-notify TITLE BODY)

Documentation

Forward OSC 9 / OSC 777 notifications to the outer terminal.

On a tty frame, re-emit TITLE and BODY as OSC 9 (empty TITLE) or OSC 777 to the frame showing this buffer, else the selected frame. On a GUI frame, fall back to ghostel-default-notify. Use as ghostel-notification-function.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel-tty-forward-notify (title body)
  "Forward OSC 9 / OSC 777 notifications to the outer terminal.
On a tty frame, re-emit TITLE and BODY as OSC 9 (empty TITLE) or
OSC 777 to the frame showing this buffer, else the selected frame.
On a GUI frame, fall back to `ghostel-default-notify'.
Use as `ghostel-notification-function'."
  (let ((frame (window-frame (get-buffer-window nil t))))
    (if (tty-type frame)
        (send-string-to-terminal
         (if (string-empty-p title)
             (format "\e]9;%s\e\\" body)
           (format "\e]777;notify;%s;%s\e\\" title body))
         frame)
      (ghostel-default-notify title body))))