controlling-tty-p
controlling-tty-p is a built-in function in `C source code
'.
(controlling-tty-p &optional TERMINAL)
Return non-nil if TERMINAL is the controlling tty of the Emacs process.
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns nil if
TERMINAL is not on a tty device.