Improve cursor line
Fix #599 improve prompt_direction behavior