notebook
notebook copied to clipboard
Support for a non-blinking cursor
Jupyter has a blinking cursor. Ideally, this should be based on my OS preferences.
At least on my Fedora system, Firefox seems learn this from Gnome.
Does the browser expose this? Can Jupyter get this property and use it?
(Apologies if this is a dupe, didn't see it...)
I doubt this is something browsers expose. Our text editor component is CodeMirror. If that exposes a way to control cursor-blinkitude, we could add a separate setting for it.
yes, codemirror as a cursorblinkyness-like
option.
You can set hat with though your custom.js
likely.
I certainly can't work with a blinking cursor so hope no blinking becomes a configuration option.
I really like jupyter notebook, big thanks to the developers. However, I too am afflicted by the cursor blink phenotype. Fortunately someone has explained a solution on their blog: http://pirsquared.org/blog/notebook-blink.html
At least the last part apparently worked for me - i.e. pasting and running the following javascript code in one of the current notebook's cells:
%%javascript
var rate = 0;
// apply setting to all current CodeMirror instances
IPython.notebook.get_cells().map(
function(c) { return c.code_mirror.options.cursorBlinkRate=rate; }
);
// make sure new CodeMirror instance also use this setting
CodeMirror.defaults.cursorBlinkRate=rate;
You can add "CodeCell": { "cm_config": {"cursorBlinkRate": 0}}
inside .jupyter/nbconfig/notebook.json
and restart jupyter notebook for cursor to stop blinking:
A piece of my config:
{
...
"CodeCell": {
"cm_config": {
"autoCloseBrackets": false,
"cursorBlinkRate": 0
}
},
...
}
@SergeyDidenko Seem to be a great solution but I cannot find .jupyter/nbconfig/notebook.json for Anaconda distribution.
Just another use case for this - I work remote using anydesk and the inherent latency in a remote session makes the blinking cursor quite wonky and hard to follow
Cursor blinking is a very annoying feature. I am trying to follow the tips you give. I have modified these two files with no results:
.jupyter/nbconfig/notebook.json:
`{ "Notebook": { "Header": false, "Toolbar": false }, "Cell": { "cm_config": { "lineNumbers": true, "styleActiveLine": true, "cursorBlinkRate": 0 } } }
` and file .jupyter/lab/user-settings/@jupyterlab/codemirror-extension/commands.jupyterlab-settings:
`{ // CodeMirror // @jupyterlab/codemirror-extension:commands // Text editor settings for all CodeMirror editors. // ************************************************
// Theme
// CSS file defining the corresponding
// .cm-s-[name] styles is loaded
"theme": "jupyter",
"styleActiveLine": true,
"cursorBlinkRate": 0
}`
When running jupyter-lab the cursor is still blinking. I have also modified the settings of CodeMirror from inside jupyter, and it looks like the commands.jupyterlab-settings:
`{ // CodeMirror // @jupyterlab/codemirror-extension:commands // Text editor settings for all CodeMirror editors. // ************************************************
// Theme
// CSS file defining the corresponding
// .cm-s-[name] styles is loaded
"theme": "jupyter",
"styleActiveLine": true,
"cursorBlinkRate": 0
}`
I have tried to modify the IPython custom.js file but the file and the folder static/ don't exist. Any help?. Thank you.
I am using: Ubuntu 20.04 Jupyter-lab 3.0.16
This is also a huge problem for me in JupyterLab on macOS. The blinking cursor is incredibly distracting, especially when using the dark theme. I tried changing browsers but the cursor blinks in all of Safari, Opera and Firefox. I would truly appreciate an option to just have a non-blinking cursor. The solution by @SergeyDidenko did not work for me. I tried adding his code to both notebook.json and jupyter_notebook_config.json, without success.
Userstyle to remove blink in JupyterLab:
@-moz-document url-prefix("http://localhost:8888/lab") {
@keyframes cm-blink {50% {opacity: 1 !important;}}
@keyframes cm-blink2 {50% {opacity: 1 !important;}}
}
in the new version of jupter lab, you can click Settings -> Settings Editor -> CodeMirror -> Cursor blinking rate, set Cursor blinking rate as 0
in the new version of jupter lab, you can click Settings -> Settings Editor -> CodeMirror -> Cursor blinking rate, set Cursor blinking rate as 0
Great, closing then.