Function: tty-top-frame

Return the topmost terminal frame on TERMINAL.
TERMINAL can be a terminal object, a frame or nil (meaning the
selected frame's terminal). This function returns nil if TERMINAL
does not refer to a text terminal. Otherwise, it returns the
top-most frame on the text terminal.

(fn &optional TERMINAL)