formatte session and read in newlines in the buffer