Reset cursor state without reopening terminal

Unix & Linux Asked by Nordine Lotfi on November 27, 2020

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?

One Answer


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.

Correct answer by Thomas Dickey on November 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP