GNU Emacs Lisp Reference Manual
Emacs works with several window systems, most notably the X Window System. Both Emacs and X use the term ``window'', but use it differently. An Emacs frame is a single window as far as X is concerned; the individual Emacs windows are not known to X at all.
x (if Emacs is
running under X) or nil (if Emacs is running on an ordinary
terminal).
term-setup-hook.
This hook is used for internal purposes: setting up communication with the window system, and creating the initial window. Users should not interfere with it.