improve startup and handling of multiline input
Authored by: mantepse 2010-10-17
Parent: [r923]
Child: [r925]