48

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.

8 Answers 8

84

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.

2
  • Sometimes after I run this one program (k9s, awesome kubectl terminal UI), this happens. The reset command worked, thanks!
    – Oliver
    Oct 9, 2020 at 13:37
  • 2
    I really should have looked for this answer 10 years ago
    – Madbreaks
    Oct 7, 2021 at 18:52
62

You may have inadvertently hit the VT320 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 use the following command to send the VT320 "unhide" command sequence:

echo -en "\e[?25h"
6
  • 2
    I just hit this, thanks for the answer. I wonder how it happened in the first place, but oh well (:
    – jwd
    Apr 29, 2019 at 21:37
  • 1
    This is by far the most likely(and useful) explanation. Switch off software flow control in the other instances, so ctrl-q/ctrl-s do nothing. Aug 24, 2019 at 16:14
  • 2
    thanks this was direct and worked perfectly :D Aug 6, 2020 at 11:07
  • I guess this escape sequence may show up when we are copying/pasting text from one terminal emulator window to another.
    – Esmu Igors
    Jan 21, 2021 at 15:24
  • This happens for me whenever an ssh session gets disconnected. Using st, only the echo -en "\e[?25h" solution works.
    – tsj
    Mar 1, 2021 at 16:53
7

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.

3
  • No, that's not it.
    – tshepang
    Feb 4, 2011 at 15:44
  • 1
    Aha, that's what happened to me! Thanks to you that I'm learning about Ctrl-Q now! Apr 27, 2011 at 12:29
  • Reading extra comments: I always wondered why did my terminal randomly lock. This might be it : D
    – arod
    May 23, 2018 at 13:42
1

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

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.

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

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

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

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.