42

I could have sworn that there was once a setting for this in the gnome-terminal "Profile".

And then in some version of Ubuntu, that setting disappeared, and I had to use System ➜ Preferences ➜ Keyboard to uncheck "Cursor blinks in text fields".

Well, neither of those seems to be working now. So how do I make the cursor stop blinking?

Isaiah
  • 59,344
Nemo
  • 665

5 Answers5

31

You can disable the blinking also from the command line (gconf-editor is not installed by default):

 gconftool-2 --set /apps/gnome-terminal/profiles/Default/cursor_blink_mode --type string off

For newer versions of gnome-terminal, the command has changed:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off
mdd
  • 1,451
  • 5
    In Ubuntu 16.04 the gsettings set ... didn't worked for me. I solved it with gsettings set org.gnome.desktop.interface cursor-blink false. – mmoya Sep 01 '16 at 10:11
  • @mmoya: Hmm, it worked for me. Did you maybe rename your terminal profile from the default name (called "default")? The disadvantage of your solution is that it disables blinking for all applications, not just gnome-terminal. – mdd Sep 01 '16 at 14:20
  • I actually named it as Default, when I opened the profile settings in the UI, it had no name. Anyway it shouldn't matter as the profile uuid is get from the gsettings get ... command, should it? – mmoya Sep 02 '16 at 15:08
  • the gsettings get command gets the uuid of a profile named default (which is the default name), does it work if you change the command to Default? – mdd Sep 05 '16 at 13:12
  • I think I used default as name because the gsettings get ... works. It'd be nice to add a note to the answer saying that the command assumes the profile is called default. – mmoya Sep 05 '16 at 15:54
  • MAKE SURE CAPS LOCK IS OFF BEFORE RUNNING THIS BECAUSE YOU CANT TURN IT OFF BECAUSE YOU HAVE NO CAPSLOCK KEY!!! Edit: It appears that setxkbmap -layout us -option maps capslock key back to capslock so you can turn capslock off and then run the original command again. – xaxxon May 28 '20 at 21:49
22

On Ubuntu Mate 20.04, the setting is at org.mate.interface cursor-blink. You can use dconf-editor to navigate there and set it to false, or

gsettings set org.mate.interface cursor-blink false
mikewhatever
  • 32,638
  • Thanks; that did it. Although one of the valid settings (the default, actually) is supposed to be "system". Is that just broken? – Nemo Jun 20 '11 at 01:55
  • I don't think it's broken, as the cursor is supposed to blink by default, or rather by design, and not only in Terminal. There is a system wide setting for that in the Keyboard control window. Not sure if you can turn it off from there though. – mikewhatever Jun 20 '11 at 02:26
  • 1
    As I mentioned in my question, I thought I disabled it globally under the Keyboard settings... But it did not have any effect on gnome-terminal. Which makes me wonder what "system" setting cursor_blink_mode is referring to. Anyway, my problem is fixed. Thanks again. – Nemo Jun 20 '11 at 02:30
  • 1
    @Nemo "system" probably refers to the value of the cursor-blink "gsetting", which you can query like so: gsettings get org.gnome.desktop.interface cursor-blink. There are other cursor-related gsettings that you could tweak as well, like cursor-blink-timeout, cursor-size, etc. – Maxy-B Jan 05 '14 at 18:20
  • I am trying to find the possible alternatives to "off" and "system". I still want a blinking cursor in the active terminal, only not in all the other ones. – Gauthier Oct 29 '14 at 09:07
  • I found this string in the source: "The possible values are "system" to use the global cursor blinking settings, or "on" or "off" to set the mode explicitly." It looks like the string should show somewhere (in gconf), although the descriptions string for the key are empty, they don't show. – Gauthier Oct 29 '14 at 09:15
  • THANK you THANK you THANK you :-) – jazcap53 Nov 22 '21 at 01:43
21

I review this post on almost every single Gnome install. Seems that the actual variable name changes every so often.

My solution: gsettings list-recursively | grep blink

Then I set the link value from True to False. As of now, it is org.gnome.desktop.interface cursor-blink, so:

gsettings set org.gnome.desktop.interface cursor-blink false

Hope this helps someone else in the future!

5

You can send an escape sequence to the terminal (any POSIX compatible, I think) setting the current cursor character using tput:

tput civis    # invisible
tput cnorm    # normal       (usually an underscore)
tput cvvis    # very visible (usually a rectangle)

Just put whatever you prefer in your local runcom script: ~/.zshrc, ~/.bashrc - whatever's your poison - or in the global one in /etc if you wish for it to run for all users.

cprn
  • 1,169
  • 2
  • 12
  • 22
1

With python3

os.popen('tput civis').read()

I've discovered that the text printed is \x1b[?25l (with the l of light).
You can try :

$ printf '\x1b[?25l'

so you can with try the others commands if you want the string format (I work with python, I don't know how this is called else).
The aventage with '\x1b' or '\33' is that we can use it with another device (per example a micropython) to regular the terminal with the STDOUT.

Kaki In
  • 11
  • 3