send text in separate chunks to work around readline bug
fix for macosx terminal chunking by line
tweak line<->char conversion