I'm running Emacs 25.2.2 on Ubuntu 17.10. Although my environment has
(getenv "TERM") returns
dumb, which is incorrect.
(getenv "TERM") return an incorrect value?
;; Subprocesses of Emacs do not have direct access to the terminal, so ;; unless told otherwise they should only assume a dumb terminal. ;; We are careful to do it late (after term-setup-hook), although the ;; new multi-tty code does not use $TERM any more there anyway. (setenv "TERM" "dumb")
If Emacs didn't set
TERM=dumb then every subprocess invocation would need to do so manually.