How to disable blinking cursors
One of the most famous methods of torture is Chinese water torture. In this torture a tied person is placed under a bucket filled with water with a tiny hole in the bottom. Water is slowly dripped on to a person's forehead, eventually driving the victim insane.
Software development is not an easy task, and often after a painful process of writing a program developers feel they should share their pains with users, so they put a part of own sufferings onto the shoulders of users in a method similar to the Chinese water torture - blinking cursors.
Fortunately, programmers are not insensitive torturers, and sometimes they provide an option in their programs to turn blinking cursers off. Often these options are not documented, and are not easily accessible, but many users can't stand the blinking cursor for a long time, because blinking cursors are very distracting.
This page was created with the aim to collect in one place all methods to disable the blinking cursor in the most popular operating systems and programs. If you know how to turn blinking off in a program not listed here, please add precise instructions as a comment at the bottom of this page.
GNU Emacs
Turning the blinking cursor off in GNU Emacs is easy. Just type:
M-x blink-cursor-mode RET
where M-x means hold ALT and type `x'.
Note that this command is effective only when Emacs displays through a window system, because then Emacs does its own cursor display. On a text-only terminal, this doesn't work. You should look for separate settings of your terminal.
If you want to turn blink OFF permanently in GNU Emacs, put in your ~/.emacs the following line:
(blink-cursor-mode (- (*) (*) (*)))
where (*) (*) (*) depicts the blinking cursor, and the minus sign negates it. :)
To achieve the same result, you can modify the command line to run Emacs with the following command line arguments -nbc or --no-blinking-cursor that will disable the blinking cursor on graphical displays.
Alternatively, if your X resource file (usually named ~/.Xdefaults or ~/.Xresources) contains the X resource name cursorBlink (class CursorBlink) then if the value of this resource is off or false or 0 at startup, Emacs disables Blink Cursor mode. Examples:
*cursorBlink: off *CursorBlink: off
Note that this doesn't work on a text-only terminal. You have to look for separate settings of your terminal to configure the terminal's cursor style. Even when the terminal default cursor is configured to be non-blinking, some terminals (such as Urxvt) interpret the cvvis ("cursor very visible") terminfo sequence as a request to start blinking the cursor again. Sending this sequence can be disabled in Emacs by adding to your .emacs configuration:
(setq visible-cursor nil)
XEmacs
The development of XEmacs was easier than the development of GNU Emacs, because XEmacs developers don't have to sign legal papers to be able to borrow existing code from GNU Emacs to XEmacs. Since the development of XEmacs was easier, XEmacs developers decided not to share their pains with users, and turned the blinking cursor off by default.
Vi
Another proof Vi is not better than Emacs is that GVIM (a GTK version of Vi IMproved) blinks the cursor by default too. If you for some reason prefer using Vi instead of Emacs, you can disable the blinking cursor in GVIM by putting the following line in ~/.gvimrc:
set guicursor=a:blinkon0
In Neovim (“improved Vi IMproved”) version 0.2 and later, put in init.vim:
set guicursor=
GTK applications in Gnome
To disable blinking cursors in fields and text boxes in Gnome and GTK applications, run one of the following programs:
gnome-control-center gnome-keyboard-properties
and select the option to disable the cursor to blink. This will create the file ~/desktop/gnome/interface/cursor_blink in your home directory.
From the command line, you can do it with the following command:
gconftool-2 --set "/desktop/gnome/interface/cursor_blink"
--type boolean "False"
In GNOME 3 cursor blinking can be disabled with gsettings:
gsettings set org.gnome.desktop.interface cursor-blink false
Make sure you run gnome-settings-daemon. In GNOME 3 this is no longer in $PATH, it's here:
/usr/lib/gnome-settings-daemon/gnome-settings-daemon
Running this is necessary if you're not using a full GNOME installation, e.g. with gnome-session or gnome-display-manager.
Update 10 July 2017: Note that in Gnome 3.24, gnome-settings-daemon has been split into 27 different executables. The one you need to run to get the caret settings to take effect is now called gsd-xsettings, e.g. /usr/lib/gnome-settings-daemon/gsd-xsettings.
Alternatively, you can put some text in a local settings.ini file. This allows you to get good behavior from GTK applications even without running a daemon. It could look something like this:
$ cat ~/.config/gtk-3.0/settings.ini [Settings] gtk-cursor-blink = false
GNOME Terminal
GNOME Terminal used to provide a special option to disable the blinking cursor. In older versions you could run gnome-terminal and select the Edit -> Current Profile menu. To configure another profile that you set up choose Edit -> Profiles, select the profile you want to edit, then click Edit. The Editing Profile dialog contains the following tabbed sections that you can use to configure GNOME Terminal:
Cursor blinks
Select this option to display a cursor that blinks. You can do it from the command line with the following command:
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/cursor_blink"
--type boolean "False"
Or do it through gconf-editor in apps/gnome-terminal/profiles/Default.
Unfortunately, in the latest version gnome-terminal 2.21.90, there is no option to disable the blinking of the cursor in the terminal anymore. You can only disable it in all Gnome applications at once by running gnome-keyboard-properties and changing it on the General tab.
However, this is now fixed in 2.23 and later versions where you can run gconf-editor and set the key /apps/gnome-terminal/profiles/Default/cursor_blink_mode from the default value to the value off. You can change this setting with a short one-line command:
gconftool-2 -s /apps/gnome-terminal/profiles/Default/cursor_blink_mode
-t string off
In GNOME 3 cursor blinking can be disabled with gsettings:
gsettings set org.gnome.desktop.interface cursor-blink false
GIMP
Put the following line in ~/.gimp-version.number/gtkrc where version.number is a GIMP version number (for example, ~/.gimp-2.2/gtkrc):
gtk-cursor-blink = 0
See GTK+ Reference Manual for more information.
GTK applications in KDE
To fix the blinking cursor issue for GTK-based Kubuntu applications (e.g. Eclipse, Gedit, Chrome) that run under the KDE desktop, put the line
gtk-cursor-blink = 0
to the file ~/.gtkrc-GTK-version.number-kdeKDE-major-version-number-or-empty depending on used versions of GTK and KDE (for example, ~/.gtkrc-2.0-kde or ~/.gtkrc-2.2-kde4).
For GTK3 under KDE in the file ~/.config/gtk-3.0/settings.ini add the following line:
gtk-cursor-blink = 0
Qt applications in KDE
In KDE applications the cursor blink rate is not set by KDE, but by the underlying Qt libraries. To disable the flashing cursor, you can perform the following steps:
- Install the package qtconfig. Depending on the version number, the package name can be qt3-qtconfig or qt4-qtconfig.
- Run the program qtconfig, or one of its aliases qtconfig-qt3, qtconfig-qt4.
- On the Interface tab scroll the field Cursor Flash Time down to the value No blinking. You can use the PageDown key to scroll down faster in large increments.
- Save this config with Ctrl+s.
Alternatively, you can do this with the command line arguments:
qtconfig -> Interface -> CursorFlashTime -> 0
This puts the following section in ~/.qt/qtrc:
[General] cursorFlashTime=0
or depending on you version, it can put the following section in ~/.config/Trolltech.conf or ~/.config/QtProject.conf:
[Qt] cursorFlashTime=0
For Qt5 apps you can use qt5noblink utility.
KDE
On KDE5 starting from Fedora 27 you can disable cursor blinking by doing this:
Edit ~/.config/kdeglobals, set in the [KDE] section.
CursorBlinkRate=0
KDE5 applications under Gnome/GTK
Add the below variable in /etc/environment, and install qt5ct (confirmed to work in Fedora, running Mate 1.22):
export QT_QPA_PLATFORMTHEME=qt5ct
Reboot your machine; then use qt5ct, change QT theme/cursor blink (cursor flash time in interface tab) for KDE5 apps under GTK environments.
Lubuntu LXDE
Here's how to stop the blinking in Lubuntu LXDE. Edit the file ~/.config/lxsession/Lubuntu/desktop.conf and under [GTK] add the line:
iNet/CursorBlink=no
Xfce
You can disable cursor blinking on Xfce by running the program xfce4-keyboard-settings and on the tab Behavior in the Cursor section check the box named Show blinking.
Alternatively, you can do this with the command line on Xfce 4.8 and older versions:
xfconf-query -c xsettings -p /Net/CursorBlink -s false
or with this command line on Xfce 4.10 and later versions where a new option -T (--toggle) to invert an existing boolean property was added:
xfconf-query -c xsettings -p /Net/CursorBlink -T
Xfce Terminal
In Xubuntu xfce4-terminal to stop cursor blinking edit the file ${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc or ~/.config/Terminal/terminalrc to:
[Configuration] MiscCursorBlinks=FALSE
Fox toolkit
In X File Explorer (Xfe) and on all programs that use Fox Toolkit to get rid of cursor blink add the following entry to the configuration file ~/.config/xfe/xferc:
blinkspeed=-1
MATE desktop
gsettings set org.mate.interface cursor-blink false
Or just navigate to Preferences / Keyboard and uncheck "Cursor blinks in text fields".
Cinnamon desktop
gsettings set org.cinnamon.desktop.interface cursor-blink false
LessTif applications
Put the following lines in your .Xdefaults or .Xresources file:
! Blink rate of the text insertion cursor in milliseconds. ! Set to zero to stop blinking. *blinkRate: 0
HTML
You can disable the non-standard <blink> tag in Firefox by entering about:config on the address bar and changing the value of browser.blink_allowed to false.
Mozilla Firefox (IceCat, Iceweasel)
Make sure you have started Firefox at least once, so that you have a profile in ~/.mozilla/firefox/default.xxx/. Go to about:config in your browser, or alternatively, edit the prefs.js file in ~/.mozilla/firefox/default.xxx/, where xxx are letters or numbers. Throughout the about:config dialog, or in the prefs.js file you have to insert / edit the following lines as shown below:
about:config, New -> Integer, ui.caretBlinkTime 0
or put in your user.js:
user_pref("ui.caretBlinkTime", 0);
See Mozilla Customization for more information.
Mozilla Thunderbird (Icedove)
Since this mail client shares the codebase with Mozilla Firefox, configuring it to not blink the cursor is very like doing it in Mozilla Firefox. In the preferences window invoked from the menu Edit->Preferences go to the tab Advanced->General and on the last option Advanced Configuration click on the button Config Editor. In the about:config window find the preference name ui.caretBlinkTime using the filter, or create a new parameter by clicking the right mouse button somewhere in this window, and selecting from the popup-menu New->Integer. Enter the parameter name ui.caretBlinkTime, and set its value to 0.
Alternatively, you can edit the prefs.js file in ~/.mozilla-thunderbird/profile.default/, where profile.default is a directory name generated by Thunderbird, and add this line to it:
user_pref("ui.caretBlinkTime", 0);
Netscape
Put the following lines in your .Xdefaults or .Xresources file:
! Set this to false to disable the <BLINK> tag. *blinkingEnabled: False
! How quickly (in milliseconds) the run light and/or logo should animate. *busyBlinkRate: 0
Electron
Closed issue here
Blink / Brave
Closed issue here
Google Chrome / Chromium
Google Chrome used to respect the GTK settings described above in the section about the configuration of GTK applications in Gnome or KDE. But in latest versions Chrome no longer honors GTK settings. Please vote up this report if you want the developers to implement optional cursor blinking in Chrome.
Google Docs
For Google Docs, simply add the following rule:
.kix-cursor {
-webkit-animation-iteration-count: 0;
}
Source. Note: May break if Google change their stylesheets.
The userstyle code above for deactivating the blinking cursor on Google Docs does not work anymore, and was Chrome-specific anyway. This one works:
@-moz-document domain(docs.google.com) {
.docs-text-ui-cursor-blink {
animation-duration: 0s;
}
}
Here is another userstyle for deactivating the blinking on sharelatex:
@-moz-document domain("www.sharelatex.com") {
.ace_cursor {
visibility: visible !important;
}
}
This code seems to work for both Google Docs and Google Slides:
.docs-text-ui-cursor-blink {
animation-name: none;
}
Initially found on: userstyles.org
Tcl/Tk
Put the following line in your .Xdefaults or .Xresources file:
*insertOffTime: 0
or add a specific Tcl/Tk application prefix (e.g. Tkinfo)
Tkinfo*insertOffTime: 0
You can create a global file /usr/lib/X11/app-defaults/tkinfo with that line that will apply to all users of your site.
To have the new options take effect, restart your X server or use the program xrdb.
xrdb -remove
xrdb -merge ~/.Xresources
or
xrdb -merge ~/.Xdefaults
and check it with
xrdb -query
Look at other standard Tk toolkit options here or here.
Tcl/Tk Wish console:
Put these lines in your .wishrc or wishrc.tcl for a non-blinking block cursor:
console eval { .console config -insertofftime 0 }
console eval { .console config -insertwidth 10 }
and fr'ex for a non-squinty font:
console eval { .console config -font { {Consolas} 12}}
URxvt
In URxvt v9.21, the cursorBlink resource is no longer strictly honored. You have to do something like this:
T=~/.terminfo/rxvt-unicode-noblink.terminfo; infocmp rxvt-unicode | sed 's/rxvt-unicode/rxvt-unicode-noblink/g' > $T echo " cvvis=," >> $T tic $T
To test it, try TERM=rxvt-unicode-noblink vi foo. You'll have to set:
URxvt*termName: rxvt-unicode-noblink
in .Xdefaults to make this permanent. You can edit the terminfo file to do other things, e.g. append blink=, to turn off text blinking. (You can also append rmcup=,smcup=, to turn off screen clearing when closing an editor - idea from shallowsky.com.) Ignoring the cursorBlink resource is apparently intentional and the change is described here.
Linux Console
Put the following line in your command shell startup file:
echo -e '\033[?17;0;127c'
Or run this command once:
sudo sh -c '/bin/echo -ne "\033[?17;0;255c"' >> /etc/issue
Then you won't even see a blinking cursor at login.
Also you can put the following in /etc/rc.local (and if you use systemd, follow various instructions to create and enable an rc-local service):
echo 0 > /sys/class/graphics/fbcon/cursor_blink
for i in $(seq 1 8); do
TERM=linux setterm --foreground white --bold on -store > /dev/tty$i
done
The first line prevents another application from overriding your terminal setting. The last 3 lines are just to not squint at gray text, the default.
See also CursorOnLinuxConsole and Cursor Appearance in the Linux Console.
Linux Kernel
You can apply the noblink patch to your local Linux kernel source tree, and recompile the kernel.
Java
The caret is rendered as a vertical line in the color specified by the CaretColor property of the associated JTextComponent. It can blink at the rate specified by the BlinkRate property.
Java Desktop System
To stop the cursor blinking in text boxes and fields, perform the following steps:
- Click Launch, then choose Preferences > Desktop Preferences > Keyboard > Behavior to start the Keyboard Behavior preference tool.
- In the Keyboard tabbed section, deselect the Cursor blinks in text boxes and fields option.
CodeMirror
To disable blinking in the JavaScript-based text editor CodeMirror, execute this JavaScript code:
CodeMirror.defaults.cursorBlinkRate=0
Code::Blocks IDE
For Code::Blocks (based on wxWidgets) you can edit the file ~/.codeblocks/default.conf, where at the node caret -> PERIOD set the attribute int to "0".
Or you can open the menu Settings -> Editor -> Margins and caret and set the caret's period to 0.
Notepad++
Slide Settings -> Style Configurator -> Caret Settings -> Blinkrate all the way to the right.
In newer versions of Notepad++ open Settings, Preferences, Editing, and drag the Blink rate slider all the way to the right.
IntelliJ IDEA and Android Studio
Unset Settings -> Editor -> General -> Appearance -> Caret blinking, or insert 0 ms.
NetBeans IDE
It's easy to turn the blinking off in NetBeans 6.8 by editing .netbeans/6.8/config/Editors/text/x-java/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml and adding:
<entry name="caret-blink-rate" xml:space="preserve">
<value><![CDATA[0]]></value>
</entry>
Processing 3.x
Put these lines in your preferences.txt for a non-blinking block cursor:
editor.caret.blink=false
editor.caret.block=true
Visual Studio Code
Add the following to your settings.json (accessible through preferences, or directly):
"editor.cursorBlinking": "solid",
"editor.cursorStyle": "block",
Linux Wine (Windows emulator)
Open up ~/.wine/drive_c/windows/win.ini. Once open, add the line
CursorBlinkRate=-1
to the [Windows] section of the INI file. This works in recent versions. The regedit trick doesn't seem to work at all.
PlayOnLinux (for Windows emulator Wine)
For PlayOnLinux (a graphical front-end for the Windows emulator Wine) open up the ~/.PlayOnLinux/wineprefix/(Program)/drive_c/windows/win.ini, where (Program) is the name of the application or game installation, and do the same thing as above. This applies to any custom wine environment.
Microsoft Windows
To stop the cursor from blinking in Micro$oft Windows applications:
- Start Regedit
- Go to HKEY_CURRENT_USER/Control Panel/Desktop
- Add a String Value with the name CursorBlinkRate
- Set its value to -1
Or just navigate to Control Panel / Keyboard, and under "Cursor blink rate" move the slider all the way to the left.
Mac OS X
In Mac OS X (at least on 10.13.5), fire up a shell (e.g., via Applications->Utilities->Terminal) and run:
defaults write -g NSTextInsertionPointBlinkPeriodOn -float 99999999 defaults write -g NSTextInsertionPointBlinkPeriodOff -float 99999999
On MacOS X 10.15, at least XCode (11.4) requires the outdated no blink setting:
defaults write -g NSTextInsertionPointBlinkPeriod -float 3600000
See more for example this and here.