Interactive mode support for multiline input
more efforts; works better for non-readline now