I donβt quite understand what you want, but depending on the terminal settings, you can type ^ H (control H) on the screen, and this will return the cursor up one position.
Also note that some terminals have the ability to move the cursor to the beginning of the line, and in this case you will go to the beginning of the line, type enough spaces to rewrite the entire line (usually available from $ COLUMNS), and then print any message or something yet.
If you specify exactly what you want, and I can answer you, I will update my answer.
source share