69

It happens often that my cursor on gnome-terminal disappears, forcing me to work on a new tab/window. It seems like a random occurrence. Does anyone else experience this? What about other X terminal emulators? How can I fix this (or maybe it's just a bug)?

update: A simple work-around is to switch away from the terminal and switch back.

update 2: I don't experience this any more, maybe because I'm using GNOME 3 version of the terminal.

tshepang
  • 65,642

10 Answers10

106

If running Ctrl+Q (as described in another answer) doesn't work, it's possible that your TTY has been mangled by some other program you've run. Try running the reset command and then the clear command (or Ctrl+L, its equivalent) to initialize your terminal.

Stephen Kitt
  • 434,908
jsbillings
  • 24,406
103

You may have inadvertently hit the VT220 escape sequence to hide the cursor. If so, then neither Ctrl+Q, nor reset, nor clear, nor Ctrl+L will help.

What worked for me was to send the VT220 "unhide" command sequence.

As suggested in a comment from Thomas Dickey, and the answer from Quigi the right way to unhide the cursor is to use the tput command to send the command sequence like this:

tput cnorm

(in my original answer I had been sending the command sequence by invoking echo -en "\e[?25h")

You can learn more about cnorm and all the other possible command sequences you can send with tput by looking at the man 5 terminfo man page.

8

Could it be that you inadvertently press Ctrl+S, sending XOFF to your terminal and thus locking it?

Next time it happens, try pressing Ctrl+Q to unlock it.

techraf
  • 5,941
6

Try tput cnorm. It brought back the cursor on my xterm. As it is based on terminal capabilities, it should be general, not specific to a particular terminal. Also, it's less disruptive than reset, and much simpler than re-installing software.

Quigi
  • 191
1

Press (Ctrl+G) or (Ctrl+A) then (Ctrl+L) to initialise the terminal. This worked for me, first selecting the group then initialising.

ggorlen
  • 105
Shaze
  • 119
  • 3
1

I landed here when searching for "chromeos terminal cursor disappeared". Turns out that it was just too dark to see in the default "dark theme". Switched to "light theme" instead.

Shadi
  • 129
0

This occurred on my PC with Ubuntu 18.04 (GNOME terminal 3.28.2). I tried the command reset, clear as well as Ctrl+L and these did not enable the cursor for me.

I gave in and used the mouse with the menu item 'Terminal|Reset and Clear' and this worked.

0

After numerous inspection, try and errors, I can say that the input method (especially non-latin-letter language) may encounter this problem. I use HIME-IM and I believe sometimes it "kidnaps" the input cursor. Changing terminal software/apps does not help if being kidnapped. However, here are some solutions if none of the above works:

  1. Just do an input method switch (like ctrl+space), and then the cursor comes back in the terminals,

or

  1. Open up the input method for configuration and then close it without anything else, and then it comes back.

This is really annoying but the disappearance of the cursor is more annoying. FYI

Greenonline
  • 1,851
  • 7
  • 17
  • 23
MTP1984
  • 16
0

On Ubuntu 22.04.3 LTS 64-bit with Gnome 42.9 and Wayland, the cursor disappeared in all terminal apps for me, but worked fine in other applications like Firefox. I'm not sure what I did to cause it (I switch between applications with Alt+Tab, so that may have been involved).

None of the other escape sequences or keyboard commands in this thread restored the cursor in my case. However, I was able to fix the issue by holding Alt and pressing Tab while keeping Alt held, then wiggling the cursor on the application selection menu.

ggorlen
  • 105
-1

reinstalling gnome,gnome-terminal, and gnome-core solved it for me.