Fix strange behavior of terminal prompt.