process-tty-name

process-tty-name is a built-in function in `C source code'.

(process-tty-name PROCESS)

Return the name of the terminal PROCESS uses, or nil if none.
This is the terminal that the process itself reads and writes on,
not the name of the pty that Emacs uses to talk with that terminal.