Seems to me it would be possible to do this with zpty? I don't think there's anyplace internally where the "raw buffer" that you're describing is stored in the form that you want here.