New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Colours in Terminal #18
Comments
What's the value of your |
|
Not yet. I've been very busy lately. @thomasf Can you have a look at this? Seems that we might need to adjust the colors we use in a terminal. |
Yeah. I have thought about looking into this before (it affects me too). Since it didnt work in the first place I haven't been able to test it with my extended palette either. I might actually have some free time tomorrow to do it. |
I think there has to be some kind of lookup table. Here's even more alternative palettes: (defcustom solarized-broken-srgb (if (eq system-type 'darwin) t nil)
"Emacs bug #8402 results in incorrect color handling on Macs. If this is t
\(the default on Macs), Solarized works around it with alternative colors.
However, these colors are not totally portable, so you may be able to edit
the \"Gen RGB\" column in solarized-definitions.el to improve them further."
:type 'boolean
:group 'solarized)
;; FIXME: The Generic RGB colors will actually vary from device to device, but
;; hopefully these are closer to the intended colors than the sRGB values
;; that Emacs seems to dislike
(defvar solarized-colors ; ANSI(Solarized terminal)
;; name sRGB Gen RGB 256 16 8
'((base03 "#002b36" "#042028" "#1c1c1c" "brightblack" "black")
(base02 "#073642" "#0a2832" "#262626" "black" "black")
(base01 "#586e75" "#465a61" "#585858" "brightgreen" "green")
(base00 "#657b83" "#52676f" "#626262" "brightyellow" "yellow")
(base0 "#839496" "#708183" "#808080" "brightblue" "blue")
(base1 "#93a1a1" "#81908f" "#8a8a8a" "brightcyan" "cyan")
(base2 "#eee8d5" "#e9e2cb" "#e4e4e4" "white" "white")
(base3 "#fdf6e3" "#fcf4dc" "#ffffd7" "brightwhite" "white")
(yellow "#b58900" "#a57705" "#af8700" "yellow" "yellow")
(orange "#cb4b16" "#bd3612" "#d75f00" "brightred" "red")
(red "#dc322f" "#c60007" "#d70000" "red" "red")
(magenta "#d33682" "#c61b6e" "#af005f" "magenta" "magenta")
(violet "#6c71c4" "#5859b7" "#5f5faf" "brightmagenta" "magenta")
(blue "#268bd2" "#2075c7" "#0087ff" "blue" "blue")
(cyan "#2aa198" "#259185" "#00afaf" "cyan" "cyan")
(green "#859900" "#728a05" "#5f8700" "green" "green"))
"This is a table of all the colors used by the Solarized color theme. Each
column is a different set, one of which will be chosen based on term
capabilities, etc.")
(defun solarized-color-definitions (mode)
(flet ((find-color (name)
(let* ((index (if window-system
(if solarized-degrade
3
(if solarized-broken-srgb 2 1))
(case (display-color-cells)
(16 4)
(8 5)
(otherwise 3)))))
(nth index (assoc name solarized-colors)))))
(let ((base03 (find-color 'base03))
(base02 (find-color 'base02))
(base01 (find-color 'base01))
(base00 (find-color 'base00))
(base0 (find-color 'base0))
(base1 (find-color 'base1))
(base2 (find-color 'base2))
(base3 (find-color 'base3))
(yellow (find-color 'yellow))
(orange (find-color 'orange))
(red (find-color 'red))
(magenta (find-color 'magenta))
(violet (find-color 'violet))
(blue (find-color 'blue))
(cyan (find-color 'cyan))
(green (find-color 'green))
(bold (if solarized-bold 'bold 'normal))
(bright-bold (if solarized-bold 'normal 'bold))
(underline (if solarized-underline t nil))
(opt-under nil)
(italic (if solarized-italic 'italic 'normal)))
(when (eq 'light mode)
(rotatef base03 base3)
(rotatef base02 base2)
(rotatef base01 base1)
(rotatef base00 base0))
(let ((back base03))
(cond ((< (display-color-cells) 16)
(setf back nil))
((eq 'high solarized-contrast)
(let ((orig-base3 base3))
(rotatef base01 base00 base0 base1 base2 base3)
(setf base3 orig-base3)))
((eq 'low solarized-contrast)
(setf back base02
opt-under t)))
;; NOTE: We try to turn an 8-color term into a 10-color term by not
;; using default background and foreground colors, expecting the
;; user to have the right colors set for them. source: https://github.com/sellout/emacs-color-theme-solarized/blob/master/solarized-definitions.el#L43 |
Hmm, I wasn't aware of the Mac problem. We might need some lookup table as well after all. |
Faces with colors for all display capabilitiesAnother importat feature is to produce faces that contains colors Example:(defvar solarized-colors
;; name sRGB Gen RGB degraded ANSI(Solarized terminal)
'((base03 "#002b36" "#042028" "#1c1c1c" "#7f7f7f")
(base02 "#073642" "#0a2832" "#262626" "#000000")
(base01 "#586e75" "#465a61" "#4e4e4e" "#0a0a00")
...
"This is a table of all the colors used by the solarized color theme. each
column is a different set, one of which will be chosen based on term
capabilities, etc.")
(defun solarized-face-for-index (facespec index)
"Creates a face from facespec where the colors use the names of
the `solarized-colors'."
(let ((new-fontspec (copy-list facespec)))
(dolist (property '(:foreground :background :color))
(when (plist-get new-fontspec property)
(plist-put new-fontspec property
(nth index (assoc (plist-get new-fontspec property)
solarized-colors)))))
(when (plist-get new-fontspec :box)
(plist-put new-fontspec :box (solarized-face-for-index
(plist-get new-fontspec :box) index)))
new-fontspec))
(defun solarized-flip (facespec)
"Convert a facespec to its lightened or darkened counterpart"
(let* ((reversing-alist '((base03 . base3) (base02 . base2) (base01 . base1)
(base00 . base0) (base0 . base00) (base1 . base01)
(base2 . base02) (base3 . base03))))
(mapcar (lambda (term) (cond ((listp term) (solarized-flip term))
((assoc term reversing-alist)
(cdr (assoc term reversing-alist)))
(t term))) facespec)))
(defun solarized-faces (facespecs mode)
(mapcar (lambda (facespec-with-name)
(let* ((name (car facespec-with-name))
(facespec (funcall
(if (eq mode 'dark) 'solarized-flip 'identity)
(second facespec-with-name)))
(flipped-facespec (solarized-flip facespec))
(facespec-tty-256 (solarized-face-for-index facespec 3))
(facespec-tty-term (solarized-face-for-index facespec 4))
(facespec-default (solarized-face-for-index facespec 2)))
`(,name
((((min-colors 257)) ,facespec-default)
(((min-colors 256)) ,facespec-tty-256)
(((min-colors 16)) ,facespec-tty-term)
;; We should rarely if ever fall to the default. If
;; so, let's set it to the default light spec and
;; hope for the best.
(t ,facespec-default))))) facespecs))
(defun solarized-color-definitions (mode)
...
(let ((bold (if solarized-bold 'bold 'normal))
(underline (if solarized-underline t nil))
(italic (if solarized-italic 'italic 'normal)))
(list
;; First list is for faces
(append
(solarized-faces
`( ;; basic
(default (:foreground base00 :background base3))
(cursor (:foreground base00 :background base3 :inverse-video t))
(fringe (:foreground base1 :background base2))
... source: https://github.com/ahyatt/emacs-color-theme-solarized/blob/master/solarized-definitions.el#L72 Adapt faces individually for different color capabilities.It might come in handy, especially considering that it is likley |
well, if you are only using emacs under a terminal you could try to replace all the values in solarized-theme.el with the ones in the 256-color column above. |
The goal is to fully support different terminal types (amount of colors) at the same time. Emacsclient can then be used in both a terminal and an window-system at the same time without strageness. Currently this is mostly a copy and paste from: https://github.com/ahyatt/emacs-color-theme-solarized/blob/master/solarized-definitions.el#L72 todo: - organize - remove old stuff - child themes - theme custom vars - hc/lc colors - docs - test, test, test
Here is some additional stuff that might be interesting: sellout/emacs-color-theme-solarized#80 (defcustom solarized-terminal-themed t
"Non-nil when the terminal emulator has been themed with Solarized.
In this scenario, we do not set the background color, in favor of the more
accurate version of the color in the default terminal background."
:type 'boolean
:group 'solarized)
(defcustom solarized-contrast 'normal
"Stick with normal! It's been carefully tested. Setting this option to high or
low does use the same Solarized palette but simply shifts some values up or
down in order to expand or compress the tonal range displayed."
:type 'symbol
:options '(high normal low)
:group 'solarized)
(defcustom solarized-broken-srgb (if (and (eq system-type 'darwin)
(eq window-system 'ns))
t
nil)
"Emacs bug #8402 results in incorrect color handling on Macs. If this is t
\(the default on Macs), Solarized works around it with alternative colors.
However, these colors are not totally portable, so you may be able to edit
the \"Gen RGB\" column in solarized-definitions.el to improve them further."
:type 'boolean
:group 'solarized)
;; FIXME: The Generic RGB colors will actually vary from device to device, but
;; hopefully these are closer to the intended colors than the sRGB values
;; that Emacs seems to dislike
(defvar solarized-colors ; ANSI(Solarized terminal)
;; name sRGB Gen RGB 256 16 8
'((base03 "#002b36" "#042028" "#1c1c1c" "brightblack" "black")
(base02 "#073642" "#0a2832" "#262626" "black" "black")
(base01 "#586e75" "#465a61" "#585858" "brightgreen" "green")
(base00 "#657b83" "#52676f" "#626262" "brightyellow" "yellow")
(base0 "#839496" "#708183" "#808080" "brightblue" "blue")
(base1 "#93a1a1" "#81908f" "#8a8a8a" "brightcyan" "cyan")
(base2 "#eee8d5" "#e9e2cb" "#e4e4e4" "white" "white")
(base3 "#fdf6e3" "#fcf4dc" "#ffffd7" "brightwhite" "white")
(yellow "#b58900" "#a57705" "#af8700" "yellow" "yellow")
(orange "#cb4b16" "#bd3612" "#d75f00" "brightred" "red")
(red "#dc322f" "#c60007" "#d70000" "red" "red")
(magenta "#d33682" "#c61b6e" "#af005f" "magenta" "magenta")
(violet "#6c71c4" "#5859b7" "#5f5faf" "brightmagenta" "magenta")
(blue "#268bd2" "#2075c7" "#0087ff" "blue" "blue")
(cyan "#2aa198" "#259185" "#00afaf" "cyan" "cyan")
(green "#859900" "#728a05" "#5f8700" "green" "green"))
"This is a table of all the colors used by the Solarized color theme. Each
column is a different set, one of which will be chosen based on term
capabilities, etc.")
(defun solarized-face-for-index (facespec index &optional back fg)
"Creates a face from facespec where the colors use the names of
the `solarized-colors'."
(let ((new-fontspec (copy-list facespec)))
(dolist (property '(:foreground :background :color))
(let ((color (plist-get new-fontspec property)))
(when color
(cond ((and solarized-terminal-themed
(eq property :background) (memq color back))
(plist-put new-fontspec property "unspecified-bg"))
((and solarized-terminal-themed
(eq property :foreground) (memq color fg))
(plist-put new-fontspec property "unspecified-fg"))
(t (plist-put new-fontspec property
(nth index (assoc color solarized-colors))))))))
(when (plist-get new-fontspec :box)
(plist-put new-fontspec :box (solarized-face-for-index
(plist-get new-fontspec :box) index)))
new-fontspec))
(defun solarized-flip (facespec)
"Convert a facespec to its lightened or darkened counterpart"
(let* ((reversing-alist '((base03 . base3) (base02 . base2) (base01 . base1)
(base00 . base0) (base0 . base00) (base1 . base01)
(base2 . base02) (base3 . base03))))
(mapcar (lambda (term) (cond ((listp term) (solarized-flip term))
((assoc term reversing-alist)
(cdr (assoc term reversing-alist)))
(t term))) facespec)))
(defun solarized-faces (back fg facespecs mode)
(mapcar (lambda (facespec-with-name)
(let* ((name (car facespec-with-name))
(facespec (funcall
(if (eq mode 'light) 'solarized-flip 'identity)
(second facespec-with-name)))
(facespec-tty-256 (solarized-face-for-index facespec 3 back fg))
(facespec-tty-term (solarized-face-for-index facespec 4 back fg))
(facespec-tty-8 (solarized-face-for-index facespec 5 back fg))
(facespec-default (if solarized-broken-srgb
(solarized-face-for-index facespec 2)
(solarized-face-for-index facespec 1))))
`(,name
((((min-colors 257)) ,facespec-default)
(((min-colors 256)) ,facespec-tty-256)
(((min-colors 16)) ,facespec-tty-term)
(((min-colors 8)) ,facespec-tty-8)
;; We should rarely if ever fall to the default. If so, let's
;; set it to the default spec and hope for the best.
(t ,facespec-default))))) facespecs))
(defun solarized-color-definitions (mode)
"Define colors that make up Solarized."
;; We define everything for dark mode, but we generate light mode
;; automatically in `solarized-faces.'
;;
;; See http://ethanschoonover.com/solarized#features for an explanation
;; of what the base00/base0 names stand for
(let* ((bold (if solarized-bold 'bold 'normal))
(bright-bold (if solarized-bold 'normal 'bold))
(underline (if solarized-underline t nil))
(opt-under (eq 'low solarized-contrast))
(italic (if solarized-italic 'italic 'normal))
(back (if (eq 'low solarized-contrast) 'base02 'base03))
(bg-back `(:background ,back))
(bg-base03 `(:background base03))
(bg-base02 `(:background base02))
(bg-base01 `(:background base01))
(bg-base00 `(:background base00))
(bg-base0 `(:background base0))
(bg-base1 `(:background base1))
(bg-base2 `(:background base2))
(bg-base3 `(:background base3))
(bg-green `(:background green))
(bg-yellow `(:background yellow))
(bg-orange `(:background orange))
(bg-red `(:background red))
(bg-magenta `(:background magenta))
(bg-violet `(:background violet))
(bg-blue `(:background blue))
(bg-cyan `(:background cyan))
(fg-base03 `(:foreground base03))
(fg-base02 `(:foreground base02))
(fg-base01 `(:foreground base01))
(fg-base00 `(:foreground base00))
(fg-base0 `(:foreground base0))
(fg-base1 `(:foreground base1))
(fg-base2 `(:foreground base2))
(fg-base3 `(:foreground base3))
(fg-green `(:foreground green))
(fg-yellow `(:foreground yellow))
(fg-orange `(:foreground orange))
(fg-red `(:foreground red))
(fg-magenta `(:foreground magenta))
(fg-violet `(:foreground violet))
(fg-blue `(:foreground blue))
(fg-cyan `(:foreground cyan))
(fg-none `(:foreground "unspecified-fg"))
(fmt-none `(:weight normal :slant normal :underline nil :inverse-video nil))
(fmt-bold `(:weight ,bold :slant normal :underline nil :inverse-video nil))
(fmt-bldi `(:weight ,bold :underline nil :inverse-video nil))
(fmt-undr `(:weight normal :slant normal :underline ,underline :inverse-video nil))
(fmt-undb `(:weight ,bold :slant normal :underline ,underline :inverse-video nil))
(fmt-undi `(:weight normal :underline ,underline :inverse-video nil))
(fmt-uopt `(:weight normal :slant normal :underline ,opt-under :inverse-video nil))
;; FIXME: not quite the same
(fmt-curl `(:weight normal :slant normal :underline t :inverse-video nil))
(fmt-ital `(:weight normal :slant ,italic :underline nil :inverse-video nil))
;; FIXME: not quite the same
(fmt-stnd `(:weight normal :slant normal :underline nil :inverse-video t))
(fmt-revr `(:weight normal :slant normal :underline nil :inverse-video t))
(fmt-revb `(:weight ,bold :slant normal :underline nil :inverse-video t))
(fmt-revbb `(:weight ,bright-bold :slant normal :underline nil :inverse-video t))
(fmt-revbbu `(:weight ,bright-bold :slant normal :underline ,underline :inverse-video t)))
(list
;; First list is for faces
(solarized-faces `(,back) '(base0 base1)
`(;; basic
(default (,@fg-base0 ,@bg-back)) ; Normal
(cursor (,@fg-base03 ,@bg-base0)) ; Cursor
(error (,@fmt-bold ,@fg-red)) ; Error
(escape-glyph-face (,@fg-red))
(fringe (,@fg-base01 ,@bg-base02))
(linum (,@fg-base01 ,@bg-base02))
(header-line (,@fg-base0 ,@bg-base02 ,@fmt-revbb)) ; Pmenu
(highlight (,@fg-none ,@bg-base02))
(hl-line (:underline ,opt-under ,@bg-base02)) ; CursorLine
... |
+1 (I'd also like to see this fixed) |
This affects me as well. OSX, Terminal App, 256 Term. |
I am also looking for a nice iterm2 xterm-256color solution. Getting the ugly blue background for solarized-dark. Will try some of the above suggestions though |
Although it kind of works, for a full solution its a bit more complicated than just replacing palettes . We are also using an extended version of solarized that is only possible with an display manager.. Ive been thinking latley that is might be a better idea to actually maintain separate defs for hi color and other color modes. I would be happy with only two versions. Either full rgb or adapted to when your terminal is configured with the 16 color solarized palette. The extra acccented colors were introduced because of the many possible combinations of modes that are available and its not certain that other colors are a good fit if the accecnted colors are not used.. (Ive been quietly experimenting with this for a while) |
I got the correct colors by modifying solarized.el for the Base 02 and Base 03 colors. I used brightblack for base 03 and black for base 02, which was #7f7f7f and #000000 respectively. In a terminal everything looks correct with these options. I then had to force byte-compile solarized theme and everything works but GUI mode is now innaccurate. The part that confuses me is that the colors that worked are part of the 16 color pallet, yet my emacs reports that it has 256 colors and my TERM is set to be 256 colors. |
well, it will actually only mostly work but not close enough is not be solid solution. |
@thomasf How's the visual testing project going, anything we can help with? |
Would also love to see a solution to this, as I am having the same issue with on OS X with iTerm2. |
+1 for this. |
I have just installed this on my xubuntu 13.04 using emacs under the command line and i get this problem as well. However it seems to have just disapeared. I am not sure how it happened and cannot reproduce it but now it looks perfect. Any word on this getting fixed properly, I still have the issue on my other computers. |
I have just been able to reproduce a kind of fix. No idea how it works as i am not that savy on the internals of emacs packages. This is exactly what i have done twice to get the theme looking, i think, the way it is meant to.
As soon as the theme installed there was a change in the way the solarized theme looked. Not sure if it now looks as intended but it is an improvement. Still, no idea why this would change anything anyways and may not even be related to this issue so. |
The above code has been working for me with the Cocoa build of Emacs 24.3.1. |
@andschwa This is another package. Ours is named just |
@bbatsov Yeah, both used to be broken, the current working Solarized Emacs theme is here: https://github.com/sellout/emacs-color-theme-solarized (color-theme-solarized). What's the status of the repair for solarized-emacs? |
This is also a problem in Emacs running on rxvt-256 terminal as well as xterm-256 on Linux. |
Yeah. sadly it is quite a big job puting all of this together in a coherent and manageable way while supporting all different variations of color schemes.. This solarized theme also has added hi/lo contrast versions of the accent colors which are used rarely but makes it harder to straight up support things like a 16 color terminal. I want to do it but I have no idea when I have the time available. |
@thomasf I guess I partially figured out what is happening. There is some configuration dependency in Emacs 24 that needs to be turned on and the Solarized themes start working in 256 color mode (including all of its derivatives like Base16 or Noctilux). Like it happened with @Nekroze all the way back in September, all I was doing, was to install bunch of new themes via MELPA repository and the problem disappeared on its own. If you need more information, just tell me what to gather and I will be glad to help in troubleshooting and finding the root cause that has left everyone here clueless for a few years. Thanks! |
Same problem here. I would love to see a fix ❤️ |
@NightMachinary How did you install the terminfo here? |
I don’t remember, google it, there was an StackExchange question I think.
…On Tue, Sep 4, 2018 at 2:47 PM srustamo ***@***.***> wrote:
@NightMachinary <https://github.com/NightMachinary> How did you install
the terminfo here
<#18 (comment)>
?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aii--vALlSo-B_xkjEhbkRzwGyckvpQHks5uXlMdgaJpZM4ACAHd>
.
|
@srustamo I encounter the same problem and I found a solution. For all folks have error when set
I have a question and answer on Emacs StackExchange about this: Set 24-bit colors terminal (Truecolor) for Solarized theme on Mac. |
@YujiShen brilliant! |
I am using terminal Emacs 25.1.1 on a Raspberry Pi Zero W running Raspbian Stretch. When I set the theme so solarized-dark, I get a blue screen. I have tried what @krksgbr suggested, and I have also tried to run Emacs using However, that gives me the same result. Any ideas? |
@martinweiss I think you need an Emacs w 24bit support. The earliest
supported v is 26, afaik.
…On Wed, Nov 14, 2018, 17:37 martinweiss ***@***.*** wrote:
I am using terminal Emacs 25.1.1 on a Raspberry Pi Zero W running Raspbian
Stretch. When I set the theme so solarized-dark, I get a blue screen.
I have tried what @krksgbr <https://github.com/krksgbr> suggested, and I
have also tried to run Emacs using
$TERM=xterm-256color emacs
However, that gives me the same result. Any ideas?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtw9ZZrn-xv3n3KwnYzdIlnG0130pT_ks5uvA6ggaJpZM4ACAHd>
.
|
Thanks for your reply. However, all colour schemes look wrong as far as I can see, so I'm not really sure what to do. Do one of the other solarized packages work? |
You also need a terminal with 24bit support. If all colors are off, it is
clearly a terminal issue.
…On Wed, Nov 14, 2018 at 19:03 martinweiss ***@***.***> wrote:
Thanks for your reply. However, all colour schemes look wrong as far as I
can see, so I'm not really sure what to do.
Do one of the other solarized packages work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtw9Z5Ao-bhd7aOOq8lWvIS51m9glqSks5uvCKqgaJpZM4ACAHd>
.
|
Hmm. But does that mean it's not possible to get correct colors without 24-bit Emacs and terminal? |
This is the conclusion we have come to on this thread😂🔫 The default theme
works fine with a 256-colors terminal though.
…On Thu, Nov 15, 2018 at 3:10 PM martinweiss ***@***.***> wrote:
Hmm. But does that mean it's not possible to get correct colors without
24-bit Emacs and terminal?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aii--parSe3By4lqO6H8v_IxT33-ZMZcks5uvVKvgaJpZM4ACAHd>
.
|
The screenshot in the first post is for Emacs running on macOS. I wasn't sure if it would be the same in Raspbian (sorry for asking I guess). It seems like Zenburn works OK too, so I'll use that on the machines that don't have GUI Emacs. |
I have tried emacs-color-theme-solarized, and it works fine in terminal. But I prefer solarized-emacs better because solarized-emacs is more active and have fine tuning for other modes. But the time comes to 2019, and I hope this issue can be fixed. I work on the terminal and need this feature very much. Thanks. |
There is an on-going pull request #283 addressing this issue. The fix is using the same approach as emacs-color-theme-solarized does. It requires you pre-set a terminal with the solarized 16-color palette which is already builtin included in gnome-terminal and iterm2. |
Ok, I will try. Thanks, @kilowu. |
The former is newer and has much better mode-specific support, but lacks a bunch of workarounds for running in the terminal, which I need. However instructions at bbatsov/solarized-emacs#18 (comment) saved me both on macos and centos. For posterity: 1. create a terminfo entry source file: touch terminfo-24bit.src. 2. add the following code to the file: # Use colon separators. xterm-24bit|xterm with 24-bit direct color mode, use=xterm-256color, setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm, setf24=\E[38:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm, # Use semicolon separators. xterm-24bits|xterm with 24-bit direct color mode, use=xterm-256color, setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, 3. compile the terminfo source: tic -x -o ~/.terminfo terminfo-24bit.src
I got this problem in my urxvt terminal. I "solved" it by running tmux and changing: (s-base03 "#002b36") to #1c1c1c in the solarized.el. I suppose at least for my terminal I should use the Xterm hex values: base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 |
The workaround mentioned above by @NightMachinary of creating a terminfo xterm-24bit works nicely in Emacs 26.3 with and without tmux. Thank you! However, I now have a new problem: anything that uses the "less" pager, like git, man etc, now complains with "WARNING: terminal is not fully functional". I am using iTerm 3.3.8 on macOS 10.14.6 and zsh. UPDATE: I found the solution. The issue was caused by the
then add something like Things do not work well when ssh into a remote session on FreeBSD, which uses termcap over terminfo. I have worked around that issue, too, but then tmux is unhappy, as it looks for the string "256" in the name of the termcap to use colour. That fails. You can launch it with option "-2" to force color, but the color is a little wrong... All in all, I am coming to realise that defining the new xterm-24bit is the wrong way round, as there are too many dependencies on the good-old xterm-256color in the wild. Perhaps the solarized theme should be updated rather than requiring the terminal to be changed to deal with all of these 24bit terminal issues. Hoping for an update @bbatsov...many thanks for your hard work. |
For what it is worth, there is a further workaround for those who use this theme on FreeBSD in a remote shell session. It involves recompiling ncurses with |
This is bizzare. So I’m using Emacs on an Ubuntu 20.04 instance over SSH with the Blink iPad app...and surprisingly I’ve gotten this to work. I followed the instructions in the latest Emacs FAQ (after building Emacs from the 27.1 source branch) Colors on a TTY, which several comments above mention and reproduce in its various versions. But I had to change the The original commit emacs-mirror/emacs@e463e57 to the FAQ referenced this “use colons” and “use semicolons” entries like in the above comments, but then it was removed without documented reason in emacs-mirror/emacs@7f6153d. I only a little bit about termcap/terminfo; can anyone here shed light on why I needed to use semicolons instead of backslash-colons, and does it hint at something deeper? For reference, I did this:
|
This is still an issue for me (arch linux with st+solarized patch). Has anyone managed to cobble together a solution? |
On macOS with alacritty terminal and emacs -nw you can get true color both within tmux and without tmux. Never did get 24bit in iTerm2 though with emacs. |
Yeah I have got it working in 24bit mode in Alacritty under Linux, MacOS and IIIRC Windows as well and with some other terminals. You might have to fiddle around with termcap files though. |
This is likely never going to be "fixed" for anything below true color. We use too many non standard solarized colors so we can't fit it all into 16 colors even if we tried and it's a huge job mapping and maintaining all those colors into something that actually displays properly on low color displays. It's probably just not worth it. At this point more and more terminals are getting 24bit color support and I think only focusing on that and non GUI toolkit environments is the right choice for this theme. |
This issue has plagued me forever. I used to get around it by changing However, to my pleasant surprise, the colors started to work after upgrading to emacs 29.1! Thought I'd post here in case anyone else has had this issue as long as I have! |
I'm not sure if this is a bug of solarized-emacs or my fault but when I load up emacs in a terminal window this is what i get:
However, my terminal has 256 color support and
M-x list-colors-display
displays all of the colours correctly. I don't know how to diagnose the issue further to determine where the problem lies.The text was updated successfully, but these errors were encountered: