-
-
Notifications
You must be signed in to change notification settings - Fork 654
Closed
Milestone
Description
The default sage colorscheme is pretty much unreadable on a black background. I can fix this by putting %colors Linux
in init.sage
, but every user with a dark terminal background has to figure that out for themselves.
We should be automatically setting that value. Unfortunately, figuring out the terminal background reliably is no easy task. Some terminals set COLORFGBG
, others react to xterm queries. Resources:
- a bash script that seems to be pretty relilable: https://github.com/rocky/bash-term-background/blob/master/term-background.sh
- an attempt to implement it in python, based on this question. For me that works with xterm but not with termite (while the bash script does work with termite): https://github.com/rocky/python-term-background
- the way emacs does it: https://github.com/emacs-mirror/emacs/blob/master/lisp/term/xterm.el#L722
- apparently xtermcontrol provides a
--get-bg
option and it works for me. soruce mirror on github - python library to get terminal colors, I didn't test this: https://github.com/dranjan/termcolors
- neovim issue to re-add detection (vim supports this, apparently got lost during neovim refactoring). Includes vim code snippet: Look at COLORFGBG for automatic background again (improved) neovim/neovim#2764
CC: @kwankyu @jhpalmieri
Component: user interface
Author: Matthias Koeppe
Branch/Commit: 49259be
Reviewer: John Palmieri
Issue created by migration from https://trac.sagemath.org/ticket/26084