Modified sage-shell:output-finished-regexp for multiline input.