2

When using an application that have an anormal tui, or print non-supported characters/terminal sequence, it usually happen that the cursor/terminal doesn't display right.

In those moment, i usually do clear && reset but while that work, it doesn't work for resetting the cursor in it's usual state, unless i close and reopen the terminal (happen on most terminal i tried this on, xterm, st, urxvt etc)

I tried most of the recommended trick on post, such as this one, and other similar to that, which fail to reset the cursor to it's initial state (eg: stay invisible)

Any recommended way to reset the state of the cursor, without closing/reopening the terminal?

2
  • 1
    Just tput cnorm affects the cursor. Sep 12 '20 at 15:40
  • YEP, work perfectly! @ThomasDickey Sep 12 '20 at 15:41
2

Just

tput cnorm

affects the cursor.

The reset command may not alter that, depending on the terminal description. It's not an explicit step done by reset, but rather something that is usually done for completeness (see tput reset also). If the terminal description used a hard reset, then (depending on the terminal emulator...) one would expect the terminal to restore the cursor. However, soft resets are preferred, and those may/may not touch all of the aspects that a hard reset does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.