Actually calculate the prompt length

fixes #36