Stefan> It'd would be a good change, yes. I don't think anybody has started
Stefan> working on that (the same holds for w32+X11).
Stefan> IIUC, the work necessary to get it to work is as follows:
Stefan> - handle all the necessary renaming (many C functions have the same name
Stefan> in the different backends). This may require introducing some
Stefan> additional indirections to dynamically decide which of the backend
Stefan> functions to use. We already have such indirections (to choose betwen
Stefan> ty and GUI code), so most of the infrastructure should be there
Stefan> already, but there's most likely still some things missing, especially
Stefan> for the features which don't exist under ttys.
Stefan> - change the various #ifdefs so that more than one of each GUI's code
Stefan> can be compiled in at the same time.
Stefan> - try and figure out what to do with all the remaining problems (similar
Stefan> to what you're saying about the indirect problems introduced by the
Stefan> multi-tty code, such as ssh-agent issues). It'll probably be a good
Stefan> time to fix all the mess we still have around the "x-*" functions
Stefan> (some of which are X11-specific but others aren't).