Update HeredocTerminal to use less duplicated code.
Update HeredocTerminal to use less duplicated code.

Jabe/irony,enginekit/irony,enginekit/irony,Jabe/irony,Jabe/irony,dbremner/irony,dbremner/irony,dbremner/irony,enginekit/irony