Return the terminal corresponding to DEVICE. DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal), the name of an X display device (HOST.SERVER.SCREEN) or a tty device file.