Thank you, your new comint changes make this change much simpler. I'm attaching the new patch, please take a look and let me know if this is reasonable to submit.