Function: comint-term-environment
comint-term-environment is a byte-compiled function defined in
comint.el.gz.
Signature
(comint-term-environment)
Documentation
Return an environment variable list for terminal configuration.
Probably introduced at or before Emacs version 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-term-environment ()
"Return an environment variable list for terminal configuration."
;; If using termcap, we specify `emacs' as the terminal type
;; because that lets us specify a width.
;; If using terminfo, we default to `dumb' because that is
;; a defined terminal type. `emacs' is not a defined terminal type
;; and there is no way for us to define it here.
;; Some programs that use terminfo get very confused
;; if TERM is not a valid terminal type.
(with-connection-local-variables
(if system-uses-terminfo
(list (format "TERM=%s" comint-terminfo-terminal)
"TERMCAP="
(format "COLUMNS=%d" (window-width)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))))