frame-terminal

frame-terminal is a built-in function in `C source code'.

(frame-terminal &optional FRAME)

Return the terminal that FRAME is displayed on.
If FRAME is nil, the selected frame is used.

The terminal device is represented by its integer identifier.