Don't use PTY + spawn - it seems to output windows line endings (don't know why)