I’m using GNU screen on OS X and get this error if I start up / use a screen session remotely:
Application initialization failed: couldn't connect to display "localhost:11.0"
Unable to initialize window system.
Is there any way to re-establish a terminal session’s connection to X?
Screen does not reset the DISPLAY environment variable when you connect to a new xsession.
You will need to reset your DISPLAY varaible to the correct value.
It is not a problem specific to osx
See here
https://superuser.com/questions/105954/updating-screen-session-environment-variables-to-reflect-new-graphical-login