Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing text cursor color in Jupyter notebooks

I'm using the dark mode in Chrome, so the background in Jupyter notebooks is black, and the text cursor is still black. Is there a way to change the text cursor (the blinking bar) in Jupyter notebooks to white, but keep everything else (all other colors) the same?

like image 747
Physics Enthusiast Avatar asked Jan 06 '20 22:01

Physics Enthusiast


3 Answers

Solved it by adding line to the file .jupiter/custom/custom.css

.cm-s-ipython .CodeMirror-cursor {border-left: 3px solid #838184 !important;}

Change #color as you want, as well as cursor width in pixels. However, try to avoid FFFFFF and 000000, because Chrome still converts them to black. Also, there is one thing I couldn't fix, namely, autocomplete box with white font and highlighting color, so you can see all suggested rows, except initial.

like image 76
Dmitrii Velibekov Avatar answered Sep 21 '22 20:09

Dmitrii Velibekov


This is a bit late but it's easier to add Jupyter Notebook / Jupyter Lab to your list of sites for Chrome to not change to dark, then use dark mode in Jupyter. You can download custom color themes for Jupyter if you don't like the built-in dark mode. I'm using Jupyter Lab and the URL I added to the list in Chrome was:

http://localhost:8888/lab

This fixed the dark invisible cursor issue for me.

like image 35
Alasdair Avatar answered Sep 24 '22 20:09

Alasdair


I solved this problem by downloading a jupyter dark theme.

pip install jupyterthemes

jt -t chesterish

like image 22
Maximo Avatar answered Sep 25 '22 20:09

Maximo