Repository: spyder-ide/spyder

Issue:
Option to Disable Blinking Cursor
Spyder does not respect system keyboard settings, and there seems to be no way to disable the blinking cursor in the editor, integrated consoles, etc. All modern IDEs provide an option to disable cursor blinking; the flashing cursor is known to irritate a lot of developers. (www.jurta.org/en/prog/noblink).

How can one tweak the Spyder settings, configuration files to make this happen?

I'm using: Linux (Ubuntu 16.04), Anaconda 4.3. This issue was also noted by a few developer friends on Windows.



Discussion:
> the flashing cursor is known to irritate a lot of developers

First time I've heard this complaint in seven years working in Spyder, so (I'm sorry to say it but) we're not going to implement this.

You're welcome to send us a pull request to implement this though.
@ccordoba12 , can you suggest me where to start if I want to implement this?
@ccordoba12 
Can you reconsider your decision?
All IDE's has this option

Thanks

**Pycharm**
![captura de pantalla 2017-07-15 a las 9 40 17](https://user-images.githubusercontent.com/168353/28237567-ae180216-6942-11e7-9f2a-eaa486b6fa8c.png)

**Visual Studio Code**
![captura de pantalla 2017-07-15 a las 9 43 41](https://user-images.githubusercontent.com/168353/28237569-b7b2c69e-6942-11e7-9578-13841ee5af28.png)

**Vim**
```
" Disable all blinking:
:set guicursor+=a:blinkon0
```

**Emacs**
` (setq visible-cursor nil)`

**Sublime text**
`"caret_style": "solid"`

**XCode**
`defaults write -g NSTextInsertionPointBlinkPeriod -int 100000`

Etc.

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -222,6 +222,7 @@ def get_focus_python_shell():
 class MainWindow(QMainWindow):
     """Spyder main window"""
     DOCKOPTIONS = QMainWindow.AllowTabbedDocks|QMainWindow.AllowNestedDocks
+    CURSORBLINK_OSDEFAULT = QApplication.cursorFlashTime()
     SPYDER_PATH = get_conf_path('path')
     BOOKMARKS = (
          ('numpy', "http://docs.scipy.org/doc/",
@@ -2540,6 +2541,11 @@ def apply_settings(self):
         self.apply_panes_settings()
         self.apply_statusbar_settings()
 
+        if CONF.get('main', 'use_custom_cursor_blinking'):
+            qapp.setCursorFlashTime(CONF.get('main', 'custom_cursor_blinking'))
+        else:
+            qapp.setCursorFlashTime(self.CURSORBLINK_OSDEFAULT)
+
     def apply_panes_settings(self):
         """Update dockwidgets features settings"""
         # Update toggle action on menu
diff --git a/spyder/config/main.py b/spyder/config/main.py
--- a/spyder/config/main.py
+++ b/spyder/config/main.py
@@ -93,6 +93,7 @@
               'cpu_usage/timeout': 2000,
               'use_custom_margin': True,
               'custom_margin': 0,
+              'use_custom_cursor_blinking': False,
               'show_internal_console_if_traceback': False,
               'check_updates_on_startup': True,
               'toolbars_visible': True,
diff --git a/spyder/plugins/configdialog.py b/spyder/plugins/configdialog.py
--- a/spyder/plugins/configdialog.py
+++ b/spyder/plugins/configdialog.py
@@ -23,7 +23,8 @@
                             QLineEdit, QListView, QListWidget, QListWidgetItem,
                             QMessageBox, QPushButton, QRadioButton,
                             QScrollArea, QSpinBox, QSplitter, QStackedWidget,
-                            QStyleFactory, QTabWidget, QVBoxLayout, QWidget)
+                            QStyleFactory, QTabWidget, QVBoxLayout, QWidget,
+                            QApplication)
 
 # Local imports
 from spyder.config.base import (_, LANGUAGE_CODES, load_lang_conf,
@@ -879,11 +880,31 @@ def setup_page(self):
                            'use_custom_margin')
         margin_spin = self.create_spinbox("", _("pixels"), 'custom_margin',
                                           0, 0, 30)
-        margin_box.toggled.connect(margin_spin.setEnabled)
-        margin_spin.setEnabled(self.get_option('use_custom_margin'))
-        margins_layout = QHBoxLayout()
-        margins_layout.addWidget(margin_box)
-        margins_layout.addWidget(margin_spin)
+        margin_box.toggled.connect(margin_spin.spinbox.setEnabled)
+        margin_box.toggled.connect(margin_spin.slabel.setEnabled)
+        margin_spin.spinbox.setEnabled(self.get_option('use_custom_margin'))
+        margin_spin.slabel.setEnabled(self.get_option('use_custom_margin'))
+        
+        cursor_box = newcb(_("Cursor blinking:"),
+                           'use_custom_cursor_blinking')
+        cursor_spin = self.create_spinbox("", _("ms"), 'custom_cursor_blinking',
+                                          default = QApplication.cursorFlashTime(),
+                                          min_=0, max_=5000, step=100)
+        cursor_box.toggled.connect(cursor_spin.spinbox.setEnabled)
+        cursor_box.toggled.connect(cursor_spin.slabel.setEnabled)
+        cursor_spin.spinbox.setEnabled(
+                self.get_option('use_custom_cursor_blinking'))
+        cursor_spin.slabel.setEnabled(
+                self.get_option('use_custom_cursor_blinking'))
+        
+        margins_cursor_layout = QGridLayout()
+        margins_cursor_layout.addWidget(margin_box, 0, 0)
+        margins_cursor_layout.addWidget(margin_spin.spinbox, 0, 1)
+        margins_cursor_layout.addWidget(margin_spin.slabel, 0, 2)        
+        margins_cursor_layout.addWidget(cursor_box, 1, 0)
+        margins_cursor_layout.addWidget(cursor_spin.spinbox, 1, 1)
+        margins_cursor_layout.addWidget(cursor_spin.slabel, 1, 2)
+        margins_cursor_layout.setColumnStretch(2, 100)
 
         # Layout interface
         comboboxes_layout = QHBoxLayout()
@@ -901,7 +922,7 @@ def setup_page(self):
         interface_layout.addWidget(verttabs_box)
         interface_layout.addWidget(animated_box)
         interface_layout.addWidget(tear_off_box)
-        interface_layout.addLayout(margins_layout)
+        interface_layout.addLayout(margins_cursor_layout)
         interface_group.setLayout(interface_layout)
 
         # --- Status bar


Test patch: