From the window system side, what it took was a terminal emulator - a program that makes a window act like a terminal. Most emulators imitate a DEC VT100 or VT102 terminal; they respond to its escape sequences, and in general masquerade pretty well.
But there's another side to the equation. The system needs to know what "terminal" a program is running on, so it can read input and send output to the right place. There's normally an association between a tty file and a physical device attached to a serial line. But what's the association for an abstraction on a workstation screen, on a device that's nothing like a serial line?