Terminal – Hide and Unhide Cursor with tput

escape-charactersterminaltput

tput civis

successfully hides the cursor.

tput cvvis

should unhide it, but it doesn't.

Any idea what the problem might be?

Best Answer

In the ncurses terminal database, cvvis is used as documented in the terminfo manual page:

   cursor_visible            cvvis  vs   make cursor very
                                         visible

and if there is no difference between normal and very visible, the cvvis capability is usually omitted. The feature is used in curs_set:

The curs_set routine sets the cursor state to invisible, normal, or very visible for visibility equal to 0, 1, or 2 respectively. If the terminal supports the visibility re-quested, the previous cursor state is returned; otherwise, ERR is returned.

The terminfo(5) manual page also says

If the cursor needs to be made more visible than normal when it is not on the bottom line (to make, for example, a non-blinking underline into an easier to find block or blinking underline) give this sequence as cvvis. If there is a way to make the cursor completely invisible, give that as civis. The capability cnorm should be given which undoes the effects of both of these modes.

Some terminal descriptions may (incorrectly) equate cvvis and cnorm, since some emacs configurations assume that cvvis is always set.

Related Question