Function: server-create-tty-frame

server-create-tty-frame is a byte-compiled function defined in server.el.gz.

Signature

(server-create-tty-frame TTY TYPE PROC &optional PARAMETERS)

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-create-tty-frame (tty type proc &optional parameters)
  (unless tty
    (error "Invalid terminal device"))
  (unless type
    (error "Invalid terminal type"))
  (let ((frame
         (server-with-environment
             (process-get proc 'env)
             '("LANG" "LC_CTYPE" "LC_ALL"
               ;; For tgetent(3); list according to ncurses(3).
               "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
               "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
               "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
               "TERMINFO_DIRS" "TERMPATH"
               ;; rxvt wants these
               "COLORFGBG" "COLORTERM")
           (server--create-frame
            ;; Ignore nowait here; we always need to
            ;; clean up opened ttys when the client dies.
            nil proc
            `((window-system . nil)
              (tty . ,tty)
              (tty-type . ,type)
              ,@parameters)))))

    ;; ttys don't use the `display' parameter, but callproc.c does to set
    ;; the DISPLAY environment on subprocesses.
    (set-frame-parameter frame 'display
                         (getenv-internal "DISPLAY" (process-get proc 'env)))
    frame))