Function: ghostel--spawn-process

ghostel--spawn-process is a natively compiled function defined in ghostel.el.

Signature

(ghostel--spawn-process PROGRAM PROGRAM-ARGS REMOTE-P)

Documentation

Dispatch the spawn of PROGRAM (with PROGRAM-ARGS) to native or Emacs.

Local PROGRAM is resolved to an absolute path before backend dispatch; a remote PROGRAM is stripped to the path the remote shell sees. Local buffers use the native PTY path when ghostel-use-native-pty is non-nil; remote (REMOTE-P) buffers always go through Emacs so TRAMP can manage the remote shell.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--spawn-process (program program-args remote-p)
  "Dispatch the spawn of PROGRAM (with PROGRAM-ARGS) to native or Emacs.
Local PROGRAM is resolved to an absolute path before backend dispatch;
a remote PROGRAM is stripped to the path the remote shell sees.
Local buffers use the native PTY path when `ghostel-use-native-pty'
is non-nil; remote (REMOTE-P) buffers always go through Emacs so
TRAMP can manage the remote shell."
  (let* ((program (if remote-p
                      (file-local-name program)
                    (ghostel--resolve-local-executable program)))
         (process (if (and ghostel-use-native-pty (not remote-p))
                      (ghostel--spawn-via-native (cons program program-args))
                    (ghostel--spawn-via-emacs program program-args remote-p))))
    (when (processp process)
      (process-put process 'adjust-window-size-function #'ignore))
    (setq ghostel--process process)
    (ghostel--sync-read-only)
    process))